github.com/DominikUrban/viper@v0.0.0-20220730150717-aaf74638bd32/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 }