Using gopm and updating go language

Time:2020-10-12

Install gopm

Using gopm, you can golang.org Some of the mirror sites are available for download.

go get -v -u github.com/gpmgo/gopm

Some common commands

#View current project dependencies
gopm list
#Show dependency details
gopm list -v
#List File Dependencies
gopm list -t [file]
#Pull dependency to cache directory
gopm get -r xxx
#Download only the currently specified package
gopm get -d xxx
#Pull dependency to $gopath
gopm get -g xxx
#Check to update all packages
gopm get -u xxx
#Pull to the current directory
gopm get -l xxx
#Run current directory program
gopm run
#Generate gopmfile of current project for package management
gopm gen -v
#According to the current project gopmfile link dependency and execute go install
gopm install -v
#Update current dependency
gopm update -v
#Clean up temporary files
gopm clean
#Compile to current directory
gopm bin

Upgrade go

It is used to uninstall the version of go in the same way as the installation

If go was previously installed through Yum or apt get, execute the relevant code to uninstall it:
yum remove go
apt-get remove go
If it is installed manually (that is, by copying to a directory), you can directly delete the go folder according to the path provided by goroot
rm -r /opt/go

Install the new version of go

Unzip:tar zxvf go1.41.linux-amd64.tar.gz

After getting the go folder, move or copy it to the go installation path you just obtained
mv ./go /opt/

The whole process keeps the environment variable unchanged, otherwise it needs to be re specified
export PATH="/usr/local/go/bin:$PATH"

Recommended Today

Practice of query operation of database table (Experiment 3)

Following the previous two experiments, this experiment is to master the use of select statements for various query operations: single table query, multi table connection and query, nested query, set query, to consolidate the database query operation.Now follow Xiaobian to practice together!Based on the data table (student, course, SC, teacher, TC) created and inserted in […]