AIUI, the version number output by `consul version` is not specified by Go,
but by the consul source itself. As far as Go is concerned, it's just be a
string constant (or maybe even a dynamically assembled string from integer
constants or Anything really). As such, there is no really reliable w
Hi Guys
Thank you for your response.
Consul is go executable. I can get version using /bin/consul version
command but I need to find the version using string search in executable
file data.
I noticed some pattern in executables
1.8.312345156252160h3100043191500ms781258760h94105:***@ => 1.8.3
Maybe you are asking how to get build version information into the
executable. If yes, then use -ldflags.
https://pmcgrath.net/include-version-information-in-golang-app
On Thursday, 13 August 2020 at 15:12:36 UTC+5:30 seank...@gmail.com wrote:
> go version -m
>
> On Thursday, August 13, 2020
go version -m
On Thursday, August 13, 2020 at 10:30:56 AM UTC+2 santhoshth...@gmail.com
wrote:
> Hi All,
>
> What is best way to know a executable version without executing it through
> golang?
>
> I tried with reading the executable file through a scanner and matching
> every line with regex