I want to define a constant whose numeric value depends on whether int
is a 32-bit or a 64-bit type on a particular target architecture. It's possible to compile go source files conditionally using Build constraints.
Are there simple build constraint clauses with predefined tags which select for one or the other? Ideally, something like:
//+build 32bit
Otherwise, I'd either have to somehow detect the size externally and use custom build tags, or maintain a large list of predefined target tags which may change with each go release. Is there a simpler way?