Skip to content

Commit 4ad31d4

Browse files
committed
fix, Make sure that $binary environment variables are never used in tests
1 parent e5e6363 commit 4ad31d4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package cmd
2+
3+
import "os"
4+
5+
func init() {
6+
// Unset environment variables that are often found as defaults in the terminal configuration.
7+
if err := os.Unsetenv("PROVIDER_TOKEN"); err != nil {
8+
panic(err)
9+
}
10+
if err := os.Unsetenv("PROVIDER_URL"); err != nil {
11+
panic(err)
12+
}
13+
}

0 commit comments

Comments
 (0)