File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ package tools
1717
1818import (
1919 "encoding/json"
20+ "runtime"
2021 "testing"
2122 "time"
2223
@@ -40,6 +41,10 @@ func TestDownloadCorrectPlatform(t *testing.T) {
4041 {"windows" , "amd64" , "x86_64-mingw32" },
4142 {"linux" , "arm" , "arm-linux-gnueabihf" },
4243 }
44+ defer func () {
45+ OS = runtime .GOOS // restore `runtime.OS`
46+ Arch = runtime .GOARCH // restore `runtime.ARCH`
47+ }()
4348 testIndex := paths .New ("testdata" , "test_tool_index.json" )
4449 buf , err := testIndex .ReadFile ()
4550 require .NoError (t , err )
@@ -72,6 +77,10 @@ func TestDownloadFallbackPlatform(t *testing.T) {
7277 {"darwin" , "arm64" , "i386-apple-darwin11" },
7378 {"windows" , "amd64" , "i686-mingw32" },
7479 }
80+ defer func () {
81+ OS = runtime .GOOS // restore `runtime.OS`
82+ Arch = runtime .GOARCH // restore `runtime.ARCH`
83+ }()
7584 testIndex := paths .New ("testdata" , "test_tool_index.json" )
7685 buf , err := testIndex .ReadFile ()
7786 require .NoError (t , err )
You can’t perform that action at this time.
0 commit comments