Skip to content

Commit

Permalink
Run 'go mod tidy' to ensure modules files are consistent with the req…
Browse files Browse the repository at this point in the history
…uirements

This is a port of the xcaddy fix: caddyserver/xcaddy#47

Closes #9
  • Loading branch information
Ivan Mirić authored and imiric committed Mar 8, 2021
1 parent d7e4293 commit a5ebc0d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ func (b Builder) Build(ctx context.Context, outputFile string) error {

log.Println("[INFO] Building k6")

// tidy the module to ensure go.mod and go.sum are consistent with the module prereq
tidyCmd := buildEnv.newCommand("go", "mod", "tidy")
if err := buildEnv.runCommand(ctx, tidyCmd, b.TimeoutGet); err != nil {
return err
}

// compile
cmd := buildEnv.newCommand("go", "build",
"-o", absOutputFile,
Expand Down

0 comments on commit a5ebc0d

Please sign in to comment.