文章目录 os 包 os 包 获取/设置环境变量 // 获取环境变量,返回 string fmt.Println(os.Getenv("PATH")) // 设置环境变量 os.Setenv("XXX_HOME"