Skip to content

Commit

Permalink
Set GOARCH to amd64 for TestListMagefilesIgnoresRespectsGOOSArg (#275)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
siddhesh authored and natefinch committed Jan 13, 2020
1 parent e353334 commit 1e0dbb8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mage/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ func TestListMagefilesIgnoresRespectsGOOSArg(t *testing.T) {
} else {
goos = "windows"
}
files, err := Magefiles("testdata/goos_magefiles", goos, "", "go", buf, false)
// Set GOARCH as amd64 because windows is not on all non-x86 architectures.
files, err := Magefiles("testdata/goos_magefiles", goos, "amd64", "go", buf, false)
if err != nil {
t.Errorf("error from magefile list: %v: %s", err, buf)
}
Expand Down

0 comments on commit 1e0dbb8

Please sign in to comment.