GO基础:显示go运行的操作系统和环境变量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)
}

  


原文地址:https://www.cnblogs.com/Wolfanature/p/5865797.html