Skip to content

Commit

Permalink
v2: Adapt PR 244 for v2
Browse files Browse the repository at this point in the history
  • Loading branch information
thockin committed Jan 31, 2024
1 parent 4f44cb3 commit e37a30e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions v2/execute.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func GoBoilerplate(headerFile, buildTag, generatedBy string) ([]byte, error) {

if generatedBy != "" {
generatorName := filepath.Base(os.Args[0])
// Strip the extension from the name to normalize output between *nix and Windows.
generatorName = generatorName[:len(generatorName)-len(filepath.Ext(generatorName))]
generatedByComment := strings.ReplaceAll(generatedBy, "GENERATOR_NAME", generatorName)
buf.WriteString(fmt.Sprintf("%s\n\n", generatedByComment))
}
Expand Down

0 comments on commit e37a30e

Please sign in to comment.