diff --git a/hack/boilerplate/boilerplate.py b/hack/boilerplate/boilerplate.py index 53b539703330..d25a1a4564dd 100755 --- a/hack/boilerplate/boilerplate.py +++ b/hack/boilerplate/boilerplate.py @@ -215,7 +215,8 @@ def get_regexs(): # company holder names can be anything regexs["date"] = re.compile(get_dates()) # strip // +build \n\n build constraints - regexs["go_build_constraints"] = re.compile(r"^(// \+build.*\n)+\n", re.MULTILINE) + regexs["go_build_constraints"] = re.compile( + r"^(//(go:build| \+build).*\n)+\n", re.MULTILINE) # strip #!.* from shell scripts regexs["shebang"] = re.compile(r"^(#!.*\n)\n*", re.MULTILINE) # Search for generated files