Skip to content

Commit

Permalink
Correct test input code to support older go versions
Browse files Browse the repository at this point in the history
Samples used for testing need to have build tags for new and old style:

//go:build tag
// +build tag
  • Loading branch information
perrito666 committed Nov 18, 2023
1 parent 0fddccb commit f7f2bff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mage/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,9 @@ func TestGoModules(t *testing.T) {
t.Fatal(err)
}
defer os.RemoveAll(dir)
err = ioutil.WriteFile(filepath.Join(dir, "magefile.go"), []byte(`//+build mage
// beware, mage builds in go versions older than 1.17 so both build tag formats need to be present
err = ioutil.WriteFile(filepath.Join(dir, "magefile.go"), []byte(`//go:build mage
//+build mage
package main
Expand Down

0 comments on commit f7f2bff

Please sign in to comment.