mirror of
https://github.com/xxjwxc/public.git
synced 2025-09-27 12:12:13 +08:00
add keywords
This commit is contained in:
@@ -64,3 +64,17 @@ func IsInternalType(t string) bool {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var keywords = []string{"var", "const", "package", "import", "func", "return",
|
||||||
|
"defer", "go", "select", "interface", "struct", "break", "case", "continue", "for",
|
||||||
|
"fallthrough", "else", "if", "switch", "goto", "default", "chan", "type", "map", "range"}
|
||||||
|
|
||||||
|
// IsKeywords 是否是关键字
|
||||||
|
func IsKeywords(t string) bool {
|
||||||
|
for _, v := range keywords {
|
||||||
|
if t == v {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user