diff --git a/hack/boilerplate/boilerplate.py b/hack/boilerplate/boilerplate.py index 5a6d3177eb1..f082266aa8b 100755 --- a/hack/boilerplate/boilerplate.py +++ b/hack/boilerplate/boilerplate.py @@ -216,9 +216,11 @@ def get_regexs(): # get_dates return 2014, 2015, 2016, 2017, or 2018 until the current year as a regex like: "(2014|2015|2016|2017|2018)"; # company holder names can be anything regexs["date"] = re.compile(get_dates()) - # strip // +build \n\n build constraints + # strip the following build constraints/tags: + # //go:build + # // +build \n\n regexs["go_build_constraints"] = re.compile( - r"^(// \+build.*\n)+\n", re.MULTILINE) + r"^(//(go:build| \+build).*\n)+\n", re.MULTILINE) # strip #!.* from scripts regexs["shebang"] = re.compile(r"^(#!.*\n)\n*", re.MULTILINE) # Search for generated files