Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix test for go 1.16 #330

Merged
merged 2 commits into from Jan 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
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
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