pelletier / go-toml

Go library for the TOML file format
https://github.com/pelletier/go-toml
Other
1.69k stars 206 forks source link

Add back missing build tag needed for Go 1.16 and earlier #809

Closed piotrbulinski closed 2 years ago

piotrbulinski commented 2 years ago

Per https://pkg.go.dev/cmd/go#hdr-Build_constraints:

Go versions 1.16 and earlier used a different syntax for build constraints, with a "// +build" prefix. The gofmt command will add an equivalent //go:build constraint when encountering the older syntax.

Adding the missing "+build" comment, so builds on go 1.16 work.

pelletier commented 2 years ago

Good catch, thank you!

piotrbulinski commented 2 years ago

@pelletier thanks for merging. Do you have a plan for releasing a new version (which would include this change)? Some of my projects builds are currently failing on go 1.16 due to this problem and it would be great to get them running without any workarounds. :)

pelletier commented 2 years ago

Done :) https://github.com/pelletier/go-toml/releases/tag/v2.0.4