1. 0
  1. 9

    Why would you want that in your prompt? Presumably the version doesn’t change very often. There also aren’t many times when you’d want to check which exact version you have.

    1. 1

      I can see if you have a bunch of go projects, you may well end up with some on one version of go, and some on another due to having not updated them since they were written. There aren’t many things that block you from version to version admittedly. On which case this might be more useful. (As a rubyist, I have my current ruby version in my prompt for that reason.)

      1. 1

        But this is just calling go version. I don’t think it’s common to have different versions of the go binary installed on the same computer. A project might have been compiled with an older version of go, but this tool won’t tell you that and anyway you can just re-compile it.

        1. 1

          If you use a go version manager ala rvm or rbenv (I’ve seen at least one released for go, although the name escapes me) then you can have multiple go binaries installed, and select from them at will. (Or even if you manage GOPATH and GOROOT I think it is by hand you could do the same). In which case go version can vary depending on which binary is first in the PATH at any one time.