4 ms·
> People can work around this for HTTP middleware because they can make files build only on specific minimum versions of Go. Your package doesn't have this magi
by i_have_to_speak 6y ago
> People can work around this for HTTP middleware because they can make files build only on specific minimum versions of Go. Your package doesn't have this magical power; it's something available only for new APIs in the Go standard library.
It is indeed possible to add build constraints to .go files to have them included for compilation only on specified minimum versions of Go, see [1]
[1] https://golang.org/pkg/go/build/#hdr-Build_Constraints https://golang.org/pkg/go/build/#hdr-Build_Constraints
- randomdata 6y agoThat's what your quote says. However, what it also says is that functionality is only available for Go versions, and therefore Go standard library versions. It is not functionality available around third-party libraries that are developed independently of the Go release cycle.