After installation and version confirmation Create a folder with VSCord and test until you get the expected results Click here to build Go language environment
#Create a test directory
$ mkdir -p ~/go/src/test
#Move to directory
$ cd ~/go/src/test
#Create a test file
$ touch test.go
#Edit test file
$ vi test.go
//test.go
package main
import "fmt"
func main() {
fmt.Printf("test, go\n")
}
#Move to the created directory
$ cd ~/go/src/hello
#Build and generate binary file
$ go build
Save with: wq, build and generate binary file
$ ./test
test, go
$ go env
Should I check the environment variables related to Go language and check around PATH?
If you change the content output in the test, you need to overwrite it, so build again
$ go build
Recommended Posts