File: env_go1_17.go

package info (click to toggle)
golang-github-spf13-viper 1.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 644 kB
  • sloc: makefile: 58
file content (18 lines) | stat: -rw-r--r-- 321 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//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)
}