From f45efec5fb6a1992408687c97bbb0720e97a3a11 Mon Sep 17 00:00:00 2001 From: Manuel Carmona Date: Fri, 21 Apr 2017 10:12:17 +0200 Subject: [PATCH] GetLanguageType and Type constants have comments now type.go comments generated from type.go.tmpl --- internal/code-generator/assets/type.go.tmpl | 2 ++ internal/code-generator/generator/test_files/type.gold | 2 ++ internal/code-generator/generator/test_files/type.test.go.tmpl | 2 ++ type.go | 2 ++ 4 files changed, 8 insertions(+) diff --git a/internal/code-generator/assets/type.go.tmpl b/internal/code-generator/assets/type.go.tmpl index 25884c4..de7592b 100644 --- a/internal/code-generator/assets/type.go.tmpl +++ b/internal/code-generator/assets/type.go.tmpl @@ -7,6 +7,7 @@ package slinguist type Type int const ( + // Language's type. Either data, programming, markup, prose, or unknown. Unknown Type = iota Data Programming @@ -14,6 +15,7 @@ const ( Prose ) +// GetLanguageType returns the given language's type. func GetLanguageType(language string) (langType Type) { langType, _ = languagesType[language] return langType diff --git a/internal/code-generator/generator/test_files/type.gold b/internal/code-generator/generator/test_files/type.gold index 88531df..a54d81c 100644 --- a/internal/code-generator/generator/test_files/type.gold +++ b/internal/code-generator/generator/test_files/type.gold @@ -7,6 +7,7 @@ package slinguist type Type int const ( + // Language's type. Either data, programming, markup, prose, or unknown. Unknown Type = iota Data Programming @@ -14,6 +15,7 @@ const ( Prose ) +// GetLanguageType returns the given language's type. func GetLanguageType(language string) (langType Type) { langType, _ = languagesType[language] return langType diff --git a/internal/code-generator/generator/test_files/type.test.go.tmpl b/internal/code-generator/generator/test_files/type.test.go.tmpl index 25884c4..de7592b 100644 --- a/internal/code-generator/generator/test_files/type.test.go.tmpl +++ b/internal/code-generator/generator/test_files/type.test.go.tmpl @@ -7,6 +7,7 @@ package slinguist type Type int const ( + // Language's type. Either data, programming, markup, prose, or unknown. Unknown Type = iota Data Programming @@ -14,6 +15,7 @@ const ( Prose ) +// GetLanguageType returns the given language's type. func GetLanguageType(language string) (langType Type) { langType, _ = languagesType[language] return langType diff --git a/type.go b/type.go index 26ae3ab..4c715d2 100644 --- a/type.go +++ b/type.go @@ -7,6 +7,7 @@ package slinguist type Type int const ( + // Language's type. Either data, programming, markup, prose, or unknown. Unknown Type = iota Data Programming @@ -14,6 +15,7 @@ const ( Prose ) +// GetLanguageType returns the given language's type. func GetLanguageType(language string) (langType Type) { langType, _ = languagesType[language] return langType