This repository has been archived by the owner on Jun 25, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paul Bergeron
committed
Feb 8, 2018
1 parent
64c3dd4
commit 4915f0d
Showing
5 changed files
with
35 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters