Skip to content

Commit

Permalink
Don't ignore requirements defined on go_repo
Browse files Browse the repository at this point in the history
  • Loading branch information
janhancic committed Feb 9, 2024
1 parent 87c0bb9 commit b0397f1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions tools/please_go/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 1.10.1
-------------
* Fix regression in 1.10.0 where module requirements passed in through `go_repo` were
ignored.

Version 1.10.0
-------------
* Inspect both the host repo and the module's go.mod when resolving dependencies in the
Expand Down
2 changes: 1 addition & 1 deletion tools/please_go/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.0
1.10.1
5 changes: 4 additions & 1 deletion tools/please_go/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ func (g *Generate) Generate() error {
if err != nil {
return err
}
g.moduleDeps = append(deps, g.moduleName)
// It's important to not override g.moduleDeps as it can already contains dependencies configured
// when `Generate` was constructed.
g.moduleDeps = append(g.moduleDeps, deps...)
g.moduleDeps = append(g.moduleDeps, g.moduleName)
g.replace = replacements

if err := g.writeConfig(); err != nil {
Expand Down

0 comments on commit b0397f1

Please sign in to comment.