-
Notifications
You must be signed in to change notification settings - Fork 191
/
util.go
75 lines (72 loc) · 1.73 KB
/
util.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package main
func extensionToHlLang(extension string) (hlExt string) {
hlExt, exists := extensionToHl[extension]
if !exists {
hlExt = "text"
}
return
}
func supportedBinExtension(extension string) bool {
_, exists := extensionToHl[extension]
return exists
}
var extensionToHl = map[string]string{
"ahk": "autohotkey",
"apache": "apache",
"applescript": "applescript",
"bas": "basic",
"bash": "sh",
"bat": "dos",
"c": "cpp",
"cfc": "coldfusion",
"clj": "clojure",
"cmake": "cmake",
"coffee": "coffee",
"cpp": "c_cpp",
"cs": "csharp",
"css": "css",
"d": "d",
"dart": "dart",
"diff": "diff",
"dockerfile": "dockerfile",
"elm": "elm",
"erl": "erlang",
"for": "fortran",
"go": "go",
"h": "cpp",
"htm": "html",
"html": "html",
"ini": "ini",
"java": "java",
"js": "javascript",
"json": "json",
"jsp": "jsp",
"kt": "kotlin",
"less": "less",
"lisp": "lisp",
"lua": "lua",
"m": "objectivec",
"nginx": "nginx",
"ocaml": "ocaml",
"php": "php",
"pl": "perl",
"proto": "protobuf",
"ps": "powershell",
"py": "python",
"rb": "ruby",
"rs": "rust",
"scala": "scala",
"scm": "scheme",
"scpt": "applescript",
"scss": "scss",
"sh": "sh",
"sql": "sql",
"tcl": "tcl",
"tex": "latex",
"toml": "ini",
"ts": "typescript",
"txt": "text",
"xml": "xml",
"yaml": "yaml",
"yml": "yaml",
}