separated GetLanguageType and languagesType map in different files due to a better generation files

This commit is contained in:
Manuel Carmona
2017-05-03 12:17:54 +02:00
parent cbf44205e0
commit 6f3ad6d30d
7 changed files with 467 additions and 508 deletions

View File

@ -1,32 +0,0 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}
type Type int
const (
// Language's type. Either data, programming, markup, prose, or unknown.
Unknown Type = iota
Data
Programming
Markup
Prose
)
// GetLanguageType returns the given language's type.
func GetLanguageType(language string) (langType Type) {
langType, ok := languagesType[language]
if !ok {
langType = Unknown
}
return langType
}
var languagesType = map[string]Type{
{{range $language, $type := . -}}
"{{ $language }}": {{ $type -}},
{{end -}}
}

View File

@ -0,0 +1,11 @@
package slinguist
// CODE GENERATED AUTOMATICALLY WITH gopkg.in/src-d/simple-linguist.v1/internal/code-generator
// THIS FILE SHOULD NOT BE EDITED BY HAND
// Extracted from github/linguist commit: {{ getCommit }}
var languagesType = map[string]Type{
{{range $language, $type := . -}}
"{{ $language }}": {{ $type -}},
{{end -}}
}