feat: always use upper string for license name

main
Tran Hau 2021-03-16 10:14:05 +00:00
parent 5dee297703
commit 7eb1ca475b
1 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,7 @@ const (
var embedFS embed.FS
// map template name with filename
// always use upercase for license name
var templates = map[string]templateInfo{
"MIT": {
filename: "mit.txt",
@ -34,6 +35,7 @@ func generateLicense(name string) (string, error) {
if name == "" {
return "", fmt.Errorf("empty license name")
}
name = strings.ToUpper(name)
templateInfo, ok := templates[name]
if !ok {