File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ package tools
17
17
18
18
import (
19
19
"encoding/json"
20
+ "runtime"
20
21
"testing"
21
22
"time"
22
23
@@ -40,6 +41,10 @@ func TestDownloadCorrectPlatform(t *testing.T) {
40
41
{"windows" , "amd64" , "x86_64-mingw32" },
41
42
{"linux" , "arm" , "arm-linux-gnueabihf" },
42
43
}
44
+ defer func () {
45
+ OS = runtime .GOOS // restore `runtime.OS`
46
+ Arch = runtime .GOARCH // restore `runtime.ARCH`
47
+ }()
43
48
testIndex := paths .New ("testdata" , "test_tool_index.json" )
44
49
buf , err := testIndex .ReadFile ()
45
50
require .NoError (t , err )
@@ -72,6 +77,10 @@ func TestDownloadFallbackPlatform(t *testing.T) {
72
77
{"darwin" , "arm64" , "i386-apple-darwin11" },
73
78
{"windows" , "amd64" , "i686-mingw32" },
74
79
}
80
+ defer func () {
81
+ OS = runtime .GOOS // restore `runtime.OS`
82
+ Arch = runtime .GOARCH // restore `runtime.ARCH`
83
+ }()
75
84
testIndex := paths .New ("testdata" , "test_tool_index.json" )
76
85
buf , err := testIndex .ReadFile ()
77
86
require .NoError (t , err )
You can’t perform that action at this time.
0 commit comments