You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I often find myself in need to define some value that should never ever change during the application runtime (e.g. release version). Idiomatically this supposed to be a const, however if I need to set value to it compile-time in Go1.x I am restricted to using var only, which often makes no sense (as in example with release version)
Currently var value can be assigned at linking stage by passing -ldflags "-X main.varname=varval".
I propose to allow setting constants during compile time in same or similar manner.
From my perspective it looks as this won't be a backward compatibility breaking change, so it would be possible to implement in Go1.x (otherwise, perhaps, this can be moved to Go2)
leighmcculloch, DeedleFake, bronze1man, chewxy, OneOfOne and 2 more