Skip to content

Commit

Permalink
fix test for go 1.16 (#330)
Browse files Browse the repository at this point in the history
* fix test for 1.16
  • Loading branch information
natefinch authored Jan 3, 2021
1 parent 07afc7d commit de7ca6c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ branches:
# library, I'm not going to worry about older versions for now.
go:
- tip
- 1.16beta1
- 1.15.x
- 1.14.x
- 1.13.x
Expand Down
12 changes: 12 additions & 0 deletions mage/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1436,6 +1436,18 @@ func Test() {
}
stderr.Reset()
stdout.Reset()

// we need to run go mod tidy, since go build will no longer auto-add dependencies.
cmd = exec.Command("go", "mod", "tidy")
cmd.Dir = dir
cmd.Env = os.Environ()
cmd.Stderr = stderr
cmd.Stdout = stdout
if err := cmd.Run(); err != nil {
t.Fatalf("Error running go mod tidy: %v\nStdout: %s\nStderr: %s", err, stdout, stderr)
}
stderr.Reset()
stdout.Reset()
code := Invoke(Invocation{
Dir: dir,
Stderr: stderr,
Expand Down

0 comments on commit de7ca6c

Please sign in to comment.