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 e96eb99
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 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 go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/globusdigital/deep-copy

go 1.23
go 1.22.0

require (
github.com/google/go-cmp v0.6.0
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 e96eb99

Please sign in to comment.