I am building a library and I need to check at runtime which version the user is using, for example to pass the version to a User agent etc... Is there a way to do that in go?
Asked
Active
Viewed 45 times
0
-
Which version of what? – JimB Sep 19 '16 at 15:20
-
The version of the library – Khaled Garbaya Sep 19 '16 at 15:21
-
1If you're building the library, then you can do whatever you want, i.e. use a "Version" variable or function. – JimB Sep 19 '16 at 15:28
-
But that will include changing the version variable every time i publish a new version – Khaled Garbaya Sep 19 '16 at 15:29
-
1You need to change the version _somewhere_, do you mean you want to set a variable at build time rather than in the source? – JimB Sep 19 '16 at 15:33
-
Yes something like that if possible – Khaled Garbaya Sep 19 '16 at 15:34