mirror of
https://github.com/spf13/viper
synced 2024-11-16 18:07:02 +00:00
19 lines
321 B
Go
19 lines
321 B
Go
|
//go:build go1.17
|
||
|
// +build go1.17
|
||
|
|
||
|
package testutil
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
// Setenv sets an environment variable to a temporary value for the
|
||
|
// duration of the test.
|
||
|
//
|
||
|
// This shim can be removed once support for Go <1.17 is dropped.
|
||
|
func Setenv(t *testing.T, name, val string) {
|
||
|
t.Helper()
|
||
|
|
||
|
t.Setenv(name, val)
|
||
|
}
|