mirror of
https://github.com/rwinkhart/go-highlite.git
synced 2026-09-05 00:17:14 -04:00
- Guard aginst non-existing syn highlighter file
- Create mod file in `examples` dir
This commit is contained in:
+5
-1
@@ -19,7 +19,11 @@ func main() {
|
||||
|
||||
var defs []*highlight.Def
|
||||
gopath := os.Getenv("GOPATH")
|
||||
files, _ := ioutil.ReadDir(gopath + "/src/github.com/zyedidia/highlight/syntax_files")
|
||||
files, lerr := ioutil.ReadDir(gopath + "/src/github.com/zyedidia/highlight/syntax_files")
|
||||
if lerr != nil {
|
||||
fmt.Println(lerr)
|
||||
return
|
||||
}
|
||||
|
||||
for _, f := range files {
|
||||
if strings.HasSuffix(f.Name(), ".yaml") {
|
||||
|
||||
Reference in New Issue
Block a user