1 Star 0 Fork 0

unomit/packr

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
env.go 527 Bytes
一键复制 编辑 原始数据 按行查看 历史
Paul Bergeron 提交于 2018-02-07 15:59 . Remove dependency on gobuffalo/envy
package packr
import (
"go/build"
"os"
"strings"
)
// GoPath returns the current GOPATH env var
// or if it's missing, the default.
func GoPath() string {
go_path := strings.Split(os.Getenv("GOPATH"), string(os.PathListSeparator))
if len(go_path) == 0 || go_path[0] == "" {
return build.Default.GOPATH
}
return go_path[0]
}
// GoBin returns the current GO_BIN env var
// or if it's missing, a default of "go"
func GoBin() string {
go_bin := os.Getenv("GO_BIN")
if go_bin == "" {
return "go"
}
return go_bin
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sodacan/packr.git
git@gitee.com:sodacan/packr.git
sodacan
packr
packr
v1.10.4

搜索帮助