github.com/ShaleApps/viper@v1.15.1-concurrent/internal/testutil/env_go1_17.go (about) 1 //go:build go1.17 2 // +build go1.17 3 4 package testutil 5 6 import ( 7 "testing" 8 ) 9 10 // Setenv sets an environment variable to a temporary value for the 11 // duration of the test. 12 // 13 // This shim can be removed once support for Go <1.17 is dropped. 14 func Setenv(t *testing.T, name, val string) { 15 t.Helper() 16 17 t.Setenv(name, val) 18 }