tartrazine/type.go

23 lines
379 B
Go
Raw Normal View History

2017-04-11 09:26:23 +00:00
package slinguist
type Type int
2017-04-11 09:26:23 +00:00
const (
// Language's type. Either data, programming, markup, prose, or unknown.
Unknown Type = iota
Data
Programming
Markup
Prose
2017-04-11 09:26:23 +00:00
)
// GetLanguageType returns the given language's type.
func GetLanguageType(language string) (langType Type) {
langType, ok := languagesType[language]
if !ok {
langType = Unknown
}
2017-04-11 09:26:23 +00:00
return langType
}