mirror of
https://github.com/caddyserver/xcaddy.git
synced 2024-11-03 07:50:30 +00:00
Run go mod tidy
in the build environment (#47)
* Run `go mod tidy` in the build environment As of go 1.16, the `go {build,test}` commands don't modify the go.mod and go.sum files (see: https://golang.org/issue/40728). We, therefore, have to run `go mod tidy` to ensure the go.mod and go.sum files are consistent with the module requirements. Closes #46 * check the error of `go mod tidy`
This commit is contained in:
parent
dabafeef18
commit
e7b19b13a2
1 changed files with 6 additions and 0 deletions
|
@ -92,6 +92,12 @@ func (b Builder) Build(ctx context.Context, outputFile string) error {
|
||||||
|
|
||||||
log.Println("[INFO] Building Caddy")
|
log.Println("[INFO] Building Caddy")
|
||||||
|
|
||||||
|
// 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
|
// compile
|
||||||
cmd := buildEnv.newCommand("go", "build",
|
cmd := buildEnv.newCommand("go", "build",
|
||||||
"-o", absOutputFile,
|
"-o", absOutputFile,
|
||||||
|
|
Loading…
Reference in a new issue