mirror of https://github.com/dmarkham/enumer.git
Only add the comment line when there is a comment
This commit is contained in:
parent
610f60356d
commit
58249b251f
|
@ -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")
|
||||||
|
if comments.String() != "" {
|
||||||
g.Printf("// %s\n", 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")
|
||||||
|
|
Loading…
Reference in New Issue