diff --git a/builder.go b/builder.go index 3814fa2..ede9f32 100644 --- a/builder.go +++ b/builder.go @@ -92,6 +92,12 @@ func (b Builder) Build(ctx context.Context, outputFile string) error { 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 cmd := buildEnv.newCommand("go", "build", "-o", absOutputFile,