Re: [go-nuts] Re: best way to know executable version without running it

2020-08-19 Thread 'Axel Wagner' via golang-nuts
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

Re: [go-nuts] Re: best way to know executable version without running it

2020-08-19 Thread thatipelli santhosh
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

[go-nuts] Re: best way to know executable version without running it

2020-08-13 Thread Sathish VJ
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-nuts] Re: best way to know executable version without running it

2020-08-13 Thread seank...@gmail.com
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