Skip to content

Commit 042972f

Browse files
committed
Update regex for go1.17 boilerplate script
1 parent 4449be7 commit 042972f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build/boilerplate/boilerplate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ def get_regexs():
139139
regexs["year"] = re.compile( 'YEAR' )
140140
# dates can be something in the 21st century
141141
regexs["date"] = re.compile( '20[0-9][0-9]' )
142-
# strip // +build \n\n build constraints
143-
regexs["go_build_constraints"] = re.compile(r"^(// \+build.*\n)+\n", re.MULTILINE)
142+
# strip // +build \n\n build and //go:build constraints
143+
regexs["go_build_constraints"] = re.compile(r"^(//\s*(\+build|go:build).*\n)+\n", re.MULTILINE)
144144
# strip #!.* from shell scripts
145145
regexs["shebang"] = re.compile(r"^(#!.*\n)\n*", re.MULTILINE)
146146
return regexs

0 commit comments

Comments
 (0)