Support Go 1.17 build stanzas (constraints)
adamdecaf opened this issue · comments
Go 1.17 is starting a migration with build constraints, so they are looking for //go:build ...
stanzas in source files before any //+build ...
lines. This breaks builds which check source code formatting/validation in CI that automatically updated.
It can be resolved with gofmt -s -w pkged.go
which will add the required line. Example
The 1.17 release notes mention this change and the design proposal has a migration section for more details.
FYI I know this project is being supplemented by go:embed
so this issue could just serve as a quick fix for folks coming from Google searches.
Thank you Adam for this hint! Abandoned that lib and now feeling way better :)