Skip to content

Commit

Permalink
Merge pull request #52 from mdlayher/master
Browse files Browse the repository at this point in the history
Comply with expected header for generated Go code
  • Loading branch information
xlab authored Jun 1, 2018
2 parents 7b42b1f + b5c34ca commit 3a95514
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions generator/gen_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ import (
)

func genLabel(noTimestamps bool) string {
// These headers comply with a recognized format for generated code, so that
// static analysis tools may recognize the code as generated and skip
// processing of these files.
//
// For more information, see:
// https://github.com/golang/go/issues/13560#issuecomment-276866852.

if noTimestamps {
tpl := "WARNING: This file has automatically been generated \nby https://git.io/c-for-go. DO NOT EDIT."
tpl := "WARNING: This file has automatically been generated \nCode generated by https://git.io/c-for-go. DO NOT EDIT."
return tpl
}
tpl := "WARNING: This file has automatically been generated on %s.\nBy https://git.io/c-for-go. DO NOT EDIT."
tpl := "WARNING: This file has automatically been generated on %s.\nCode generated by https://git.io/c-for-go. DO NOT EDIT."
return fmt.Sprintf(tpl, time.Now().Format(time.RFC1123))
}

Expand Down

0 comments on commit 3a95514

Please sign in to comment.