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)
}

  


 

posted on 2016-09-12 18:30  荆南山砍柴人  阅读(278)  评论(0编辑  收藏  举报

导航