From 528f54cb857d79826da59cba0a432959cec3a51b Mon Sep 17 00:00:00 2001 From: Susisu Date: Fri, 16 Aug 2019 13:10:30 +0900 Subject: [PATCH] Print better error message when package name is empty --- pkg/generator/generator.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/generator/generator.go b/pkg/generator/generator.go index ff618e7..7f147cf 100644 --- a/pkg/generator/generator.go +++ b/pkg/generator/generator.go @@ -100,6 +100,9 @@ func getData(name string, keyType string, valueType string, wd string) (template if genPkg == nil { return templateData{}, fmt.Errorf("unable to find package info for " + wd) } + if genPkg.Name == "" { + return templateData{}, fmt.Errorf("unable to find package name for " + wd) + } var err error data.Name = name