Skip to content

Commit

Permalink
chore(generator): always use lib name as "generated by"
Browse files Browse the repository at this point in the history
  • Loading branch information
matansh committed Oct 17, 2024
1 parent c11000f commit 14c3b36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deepcopy/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (o %s%s) %s() %s%s {
func (g Generator) generateFile(w io.Writer, p *packages.Package) error {
var file bytes.Buffer

fmt.Fprintf(&file, "// Code generated by %s; DO NOT EDIT.\n\npackage %s\n\n", strings.Join(os.Args, " "), p.Name)
fmt.Fprintf(&file, "// Code generated by deep-copy %s; DO NOT EDIT.\n\npackage %s\n\n", strings.Join(os.Args[1:], " "), p.Name)

for _, tag := range g.buildTags {
fmt.Fprintf(&file, "//go:build %s\n// +build %s\n", tag, tag)
Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func Test_run(t *testing.T) {
}
}

var re = regexp.MustCompile(`Code generated by .*deep-copy.*; DO NOT EDIT.`)
var re = regexp.MustCompile(`Code generated by deep-copy.*; DO NOT EDIT.`)

func normalizeComment(in []byte) []byte {
return re.ReplaceAll(bytes.TrimSpace(in), []byte("Code generated by deep-copy; DO NOT EDIT."))
Expand Down

0 comments on commit 14c3b36

Please sign in to comment.