Skip to content

Commit f1914cc

Browse files
committed
internal/aliases: use testing.T.Setenv in tests
Change-Id: Ib6de3aee0348a3db37a75c63e118632384fa4891 Reviewed-on: https://go-review.googlesource.com/c/tools/+/563975 Run-TryBot: Tim King <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Robert Findley <[email protected]>
1 parent 945a754 commit f1914cc

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

internal/aliases/aliases_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"go/parser"
1010
"go/token"
1111
"go/types"
12-
"os"
1312
"testing"
1413

1514
"golang.org/x/tools/internal/aliases"
@@ -49,9 +48,7 @@ func TestNewAlias(t *testing.T) {
4948

5049
for _, godebug := range []string{"", "gotypesalias=1"} {
5150
t.Run(godebug, func(t *testing.T) {
52-
saved := os.Getenv("GODEBUG")
53-
defer os.Setenv("GODEBUG", saved)
54-
os.Setenv("GODEBUG", godebug) // non parallel.
51+
t.Setenv("GODEBUG", godebug)
5552

5653
A := aliases.NewAlias(token.NoPos, pkg, "A", tv.Type)
5754
if got, want := A.Name(), "A"; got != want {

0 commit comments

Comments
 (0)