Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I am surprised I only saw one comment for goenv. This is literally the easiest way for all languages that have something similar (Python, Ruby, Go, Terraform, etc.). You need to uninstall all your go binaries, then install goenv, and all you have to do is to put in a project a .go-version file containing a single line with the version you need. The files are searched by the tool in a hierarchical order: if in the current directory where go is ran, no .go-version file is found, the tool will look up one directory, if there’s no ../.go-version will try again and so on. Let’s say in the end you will want to run the same go-version across all your projects, all you have to do is to find the first common parent directory and put a .go-version file in there, or simply just put a file in the root directory (/.go-version) or just use the global file (~/.goenv/version).