Merge pull request #7 from dmarkham/new-comment

Only add the comment line when there is a comment
This commit is contained in:
Dan Markham 2019-04-04 18:52:02 -07:00 committed by GitHub
commit 296228769d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -110,7 +110,9 @@ func main() {
// Print the header and package clause.
g.Printf("// Code generated by \"enumer %s\"; DO NOT EDIT.\n", strings.Join(os.Args[1:], " "))
g.Printf("\n")
g.Printf("// %s\n", comments.String())
if comments.String() != "" {
g.Printf("// %s\n", comments.String())
}
g.Printf("package %s", g.pkg.name)
g.Printf("\n")
g.Printf("import (\n")