Only add the comment line when there is a comment

This commit is contained in:
Dan Markham 2019-04-04 18:48:04 -07:00
parent 610f60356d
commit 58249b251f
No known key found for this signature in database
GPG Key ID: 7994037517927D77
1 changed files with 3 additions and 1 deletions

View File

@ -110,7 +110,9 @@ func main() {
// Print the header and package clause. // Print the header and package clause.
g.Printf("// Code generated by \"enumer %s\"; DO NOT EDIT.\n", strings.Join(os.Args[1:], " ")) g.Printf("// Code generated by \"enumer %s\"; DO NOT EDIT.\n", strings.Join(os.Args[1:], " "))
g.Printf("\n") 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("package %s", g.pkg.name)
g.Printf("\n") g.Printf("\n")
g.Printf("import (\n") g.Printf("import (\n")