From e2b4c3882762406fd3da16f5865cfc3e36e048b5 Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Wed, 1 Aug 2018 00:37:11 +0100 Subject: Migrate from esc to packr for static files --- vendor/github.com/gobuffalo/packr/env.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 vendor/github.com/gobuffalo/packr/env.go (limited to 'vendor/github.com/gobuffalo/packr/env.go') diff --git a/vendor/github.com/gobuffalo/packr/env.go b/vendor/github.com/gobuffalo/packr/env.go new file mode 100644 index 0000000..2c744e7 --- /dev/null +++ b/vendor/github.com/gobuffalo/packr/env.go @@ -0,0 +1,27 @@ +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 +} -- cgit v1.2.3