fmt.Println(runtime.GOROOT())// GO 路径
fmt.Println(runtime.Version())//GO 版本信息 go1.9
fmt.Println(os.Hostname()) //获得PC名
fmt.Println(net.Interfaces()) //获得网卡信息
fmt.Println(runtime.GOARCH)//系统构架 386、amd64
fmt.Println(runtime.GOOS) //系统版本 windows

转载于:https://my.oschina.net/luqili/blog/1554373