Skip to content

Commit

Permalink
return true
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Feb 1, 2020
1 parent dc95650 commit 3dbe4c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
11 changes: 2 additions & 9 deletions envy.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,9 @@ func loadEnv() {
}
}

// Mods returns true if module support is enabled, false otherwise
// See https://github.com/golang/go/wiki/Modules#how-to-install-and-activate-module-support for details
// Mods always returns true, GOPATH isn't supported
func Mods() bool {
go111 := Get(GO111MODULE, "")

if !InGoPath() {
return go111 != "off"
}

return go111 == "on"
return true
}

// Reload the ENV variables. Useful if
Expand Down
14 changes: 0 additions & 14 deletions envy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ var _ = func() error {
return nil
}()

func Test_Mods(t *testing.T) {
r := require.New(t)
Temp(func() {
Set(GO111MODULE, "off")
r.False(Mods())
Set(GO111MODULE, "on")
r.True(Mods())
Set(GO111MODULE, "auto")
r.Equal(!InGoPath(), Mods())
Set(GO111MODULE, "")
r.Equal(!InGoPath(), Mods())
})
}

// envy should detect when running as a unit test and return GO_ENV=test if otherwise undefined
// func Test_GO_ENVUnitTest(t *testing.T) {
// r := require.New(t)
Expand Down

0 comments on commit 3dbe4c9

Please sign in to comment.