Skip to content

Commit 1e0dbb8

Browse files
siddheshnatefinch
authored andcommitted
Set GOARCH to amd64 for TestListMagefilesIgnoresRespectsGOOSArg (#275)
The TestListMagefilesIgnoresRespectsGOOSArg test tries to list go files with a different GOOS arg by setting GOOS to windows on Linux systems and vice versa. This test works fine on amd64, but breaks on arm64 because a windows/arm64 pair is not available yet and as a result, the `go list` command underlying the `Magefiles` function fails. Fix this problem by keeping GOARCH as amd64 so that the go list command does not fail.
1 parent e353334 commit 1e0dbb8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mage/main_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ func TestListMagefilesIgnoresRespectsGOOSArg(t *testing.T) {
206206
} else {
207207
goos = "windows"
208208
}
209-
files, err := Magefiles("testdata/goos_magefiles", goos, "", "go", buf, false)
209+
// Set GOARCH as amd64 because windows is not on all non-x86 architectures.
210+
files, err := Magefiles("testdata/goos_magefiles", goos, "amd64", "go", buf, false)
210211
if err != nil {
211212
t.Errorf("error from magefile list: %v: %s", err, buf)
212213
}

0 commit comments

Comments
 (0)