I have a program in Go that I want to compile into a bunch of binaries, each of which has a const value, defined differently. More clearly, I have something like this:
const wordLen = 6 type knowledge [wordLen]byte
Here wordLen is associated with a value of 6, but I want to have different binaries with values ββfrom 5 to 10. I could make it a variable and then use a slice rather than an array, but that will have a huge impact on my softness (yes, I tried )
I would like to have some kind of build tag on the go build argument to indicate that the wordLen value wordLen for this binary. So what is the way (as idiomatic as possible) to do this?
source share