The govulncheck tool
The purpose of the govulncheck tool is to find vulnerabilities in project dependencies. This means that it is there to make your Go binaries and Go modules more secure.
Installing the tool
You can install govulncheck by running the following command:
$ go install golang.org/x/vuln/cmd/govulncheck@latest
$ cd ~/go/bin
$ ls -lh govulncheck
-rwxr-xr-x@ 1 mtsouk staff 11M Dec 9 19:41 govulncheck
As expected, the govulncheck binary is going to be installed in ~/go/bin.
The relevant Go code can be found inside ch12/vulcheck—the source code file is called vul.go and contains the following code:
package main
import (
"fmt"
"golang.org/x/text/language"
)
func main() {
greece := language.Make("el")
en := language.Make("en")
fmt.Println(greece.Region())
fmt.Println(en.Region())
}
Running vul.go requires executing the following commands first:
$ go mod init
$ go mod...