Installing Go 1.18beta2
Go 1.18beta2 may be installed a number of ways:
- On a clean system: install Go 1.18beta2 on a system without Go
- Using Go: or use an earlier version of Go to install Go 1.18beta2
On a clean system
Download the appropriate file from the Go download page under the section #go1.18beta2.
Follow the normal instructions, subsituting the above file for the one from the instructions.
Using Go
If the system already has a recent version of Go installed, Go 1.18beta2 may be installed with the following commands:
Download the Go 1.18beta2 installer:
go install golang.org/dl/go1.18beta2@latest
Depending on how your system is configured, the installer was downloaded to three possible locations. The following command will ensure the path to the installer is part of the shell’s path:
{ [ -d "${GOBIN}" ] && _D="${GOBIN}"; } || \
{ [ -d "${GOPATH}" ] && [ -d "${GOPATH}/bin" ] && _D="${GOPATH}/bin"; } || \
_D="${HOME}/go/bin" && _F="${_D}/go1.18beta2" && \
{ [ -f "${_F}" ] && export PATH="${_D}:${PATH}"; } ||
echo "Could not locate go1.18beta2 program" 1>&2
Run the following command to install Go 1.18beta2:
go1.18beta2 download
Verify
go1.18beta2
is available:$ go1.18beta2 version
go version go1.18beta2 linux/amd64
Next: Installing delve