cmd/link: "-X main.version" when version has a value and is later used in a global struct literal doesn't work #34675
What version of Go are you using (
The issue is that for something like:
the compiler recognizes that
Then later when we link with
because the linker doesn't know it needs to modify B as well.
I see at least a few options here: