Uuntu20.04 Golang
git
sudo apt install git
export PATH=$PATH:/usr/local/go/bin
source ~/.bashrc
sudo gedit ~/.bashrc
go version
no required module provides package github.com/lib/pq: go.mod file not found in current directory or any parent directory; see 'go help modules'
git
sudo apt install git
go get github.com/lib/pq
go help modules
a1@a1-System-Product-Name:~/golang/01$ go help modulesModules are how Go manages dependencies.A module is a collection of packages that are released, versioned, anddistributed together. Modules may be downloaded directly from version controlrepositories or from module proxy servers.For a series of tutorials on modules, seehttps://golang.org/doc/tutorial/create-module.For a detailed reference on modules, see https://golang.org/ref/mod.By default, the go command may download modules from https://proxy.golang.org.It may authenticate modules using the checksum database athttps://sum.golang.org. Both services are operated by the Go team at Google.The privacy policies for these services are available athttps://proxy.golang.org/privacy and https://sum.golang.org/privacy,respectively.The go command's download behavior may be configured using GOPROXY, GOSUMDB,GOPRIVATE, and other environment variables. See 'go help environment'and https://golang.org/ref/mod#private-module-privacy for more information.a1@a1-System-Product-Name:~/golang/01$
VSCODE
https://future-architect.github.io/articles/20201117/
>Go: Install/Update Tools
と入力する。