Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find out the version of Go a Binary was built with?

Tags:

Is there a way to tell what go version a binary was built with?

I have multiple go instances on my workstation, so I want to verify that the correct one was used.

like image 502
Kyle Brandt Avatar asked Sep 24 '13 19:09

Kyle Brandt


People also ask

What is the Go binary?

Go Binaries is an open-source server allowing non-Go users to quickly install tools written in Golang, without installing the Go compiler or a package manager — all you need is curl .

Where is the Go binary?

It should be in $GOPATH/src/yourpath - using symlinks here is very useful. Then it will be published to the relative $GOPATH/bin location :) Show activity on this post.

Do I need Go installed to run a Go binary?

This means that a Go binary does not need system dependencies such as Go tooling to run on a new system. Putting these executables in an executable filepath on your own system will allow you to run the program from anywhere on your system. This is the same thing as installing the program onto your system.


1 Answers

The following command should do it:

# strings binary_path | grep 'go1\.' 
go1.5.3
like image 53
hryamzik Avatar answered Sep 29 '22 10:09

hryamzik