Skip to content
This repository was archived by the owner on Oct 2, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions update-license/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ const (
var (
flagDryRun = flag.Bool("dry", false, "Do not edit files and just print out what files would be edited")

flagSkipYearUpdate = flag.Bool("skip-year-update", true, "Ignore updating header if only change is year")

lineSkipPrefixes = []string{
"// Code generated by",
"// @generated",
Expand Down Expand Up @@ -141,6 +143,9 @@ func updateLines(lines []string, year int) []string {
break
}
if strings.HasPrefix(line, headerPrefix) {
if *flagSkipYearUpdate {
return lines
}
lines[i] = headerString(year)
return lines
}
Expand Down