Skip to content

Commit

Permalink
Update go.mod after API scaffold generation
Browse files Browse the repository at this point in the history
  • Loading branch information
dastergon committed Feb 25, 2021
1 parent 33036c5 commit f99c018
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/plugins/golang/v2/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ func (p *createAPISubcommand) PostScaffold() error {
return fmt.Errorf("unknown pattern %q", p.pattern)
}

err := util.RunCmd("Running go mod tidy", "go", "mod", "tidy")
if err != nil {
return err
}

if p.runMake { // TODO: check if API was scaffolded
return util.RunCmd("Running make", "make", "generate")
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/plugins/golang/v3/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ func (p *createAPISubcommand) PostScaffold() error {
return fmt.Errorf("unknown pattern %q", p.pattern)
}

err := util.RunCmd("Running go mod tidy", "go", "mod", "tidy")
if err != nil {
return err
}

if p.runMake { // TODO: check if API was scaffolded
return util.RunCmd("Running make", "make", "generate")
}
Expand Down

0 comments on commit f99c018

Please sign in to comment.