GO基础:显示go运行的操作系统和环境变量GOPATH
// 显示运行的操作系统和环境变量GOPATH
package main import ( "fmt" "os" "runtime" ) func main() { var goos string = runtime.GOOS fmt.Printf("The operation os is: %s\n", goos) goPath := os.Getenv("GOPATH") fmt.Printf("The goPath is: %s\n", goPath) }