diff --git a/update-license/main.go b/update-license/main.go index 06668c7..5dc60fa 100644 --- a/update-license/main.go +++ b/update-license/main.go @@ -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", @@ -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 }