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