Skip to content

Commit

Permalink
Merge pull request #25 from railwayapp/jr/conditional-go-sum-copy
Browse files Browse the repository at this point in the history
onyl copy go.sum file if it exists
  • Loading branch information
coffee-cup authored Feb 17, 2025
2 parents 2f0b684 + d6bbfd2 commit 1da69ee
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/providers/golang/golang.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,13 @@ func (p *GoProvider) Install(ctx *generate.GenerateContext, packages *generate.M

install := ctx.NewCommandStep("install")
install.AddCache(p.goBuildCache(ctx))
install.AddCommands([]plan.Command{
plan.NewCopyCommand("go.mod"),
plan.NewCopyCommand("go.sum"),
plan.NewExecCommand("go mod download"),
})
install.AddCommand(plan.NewCopyCommand("go.mod"))

if ctx.App.HasMatch("go.sum") {
install.AddCommand(plan.NewCopyCommand("go.sum"))
}

install.AddCommand(plan.NewExecCommand("go mod download"))

// If CGO is enabled, we need to install the gcc packages
if p.hasCGOEnabled(ctx) {
Expand Down

0 comments on commit 1da69ee

Please sign in to comment.