moovweb / gvm

Go Version Manager
http://github.com/moovweb/gvm
MIT License
9.87k stars 520 forks source link

gvm cd fails with Unrecognized command line argument: '' #477

Open stackbaek opened 2 months ago

stackbaek commented 2 months ago

When .go-version file contains go version without go (e.g. 1.22, instead of go1.22), cd-ing into this directory prints error

Unrecognized command line argument: ''

We should consider allowing version without the prefix go in the regex https://github.com/moovweb/gvm/blob/dd652539fa4b771840846f8319fad303c7d0a8d2/scripts/env/cd#L184