This repository was archived by the owner on Jun 25, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove packr2 dep on envy Extract the only parts needed from envy. This will prevent the envy package to load .env files on init and cause unexpected behavior. * Fix duplicate go version in disk-pack/go.mod
- Loading branch information
1 parent
af4670f
commit b4b6d10
Showing
7 changed files
with
53 additions
and
24 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
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,37 @@ | ||
package internal | ||
|
||
import ( | ||
"os" | ||
"runtime" | ||
"strings" | ||
) | ||
|
||
// Mods returns true when go modules supports is enabled | ||
func Mods() bool { | ||
go111 := os.Getenv("GO111MODULE") | ||
|
||
if !inGoPath() { | ||
return go111 != "off" | ||
} | ||
|
||
return go111 == "on" | ||
} | ||
|
||
func inGoPath() bool { | ||
pwd, _ := os.Getwd() | ||
for _, p := range GoPaths() { | ||
if strings.HasPrefix(pwd, p) { | ||
return true | ||
} | ||
} | ||
return false | ||
} | ||
|
||
// GoPaths return the defined gopath list. | ||
func GoPaths() []string { | ||
gp := os.Getenv("GOPATH") | ||
if runtime.GOOS == "windows" { | ||
return strings.Split(gp, ";") // Windows uses a different separator | ||
} | ||
return strings.Split(gp, ":") | ||
} |
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