markbates / pkger

Embed static files in Go binaries (replacement for gobuffalo/packr)
MIT License
1.19k stars 60 forks source link

Support Go 1.17 build stanzas (constraints) #151

Open adamdecaf opened 3 years ago

adamdecaf commented 3 years ago

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.

adamdecaf commented 3 years ago

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.

flamedmg commented 2 years ago

Thank you Adam for this hint! Abandoned that lib and now feeling way better :)