Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency inconsistency caused by replace #1574

Closed
HappyHacker123 opened this issue Sep 9, 2024 · 2 comments
Closed

Dependency inconsistency caused by replace #1574

HappyHacker123 opened this issue Sep 9, 2024 · 2 comments

Comments

@HappyHacker123
Copy link

HappyHacker123 commented Sep 9, 2024

What is the problem this feature would solve? Please describe.
Currently doctl depends on github.com/digitalocean/godo v1.121.0 but do not follow to use the replace directive declared in godo's go.mod as below. Repo godo uses replace directive to pin github.com/stretchr/objx to version v0.2.0 and golang.org/x/crypto to version v0.0.0-20200420201142-3c4aac89819a.

replace github.com/stretchr/objx => github.com/stretchr/objx v0.2.0
replace golang.org/x/crypto => golang.org/x/crypto v0.0.0-20200420201142-3c4aac89819a

According to Go Modules wikis, replace directives in modules other than the main module are ignored when building the main module. It means such replace usage in go.mod cannot be inherited by downstream projects automatically. Consequently, doctl's version of github.com/stretchr/objx and golang.org/x/crypto is different from the pinned version github.com/digitalocean/godo needed.

Possible Solution.

  1. Remove the replace usage in github.com/digitalocean/godo.
  2. Add the same replace rule to your go.mod
replace github.com/stretchr/objx => github.com/stretchr/objx v0.2.0
replace golang.org/x/crypto => golang.org/x/crypto v0.0.0-20200420201142-3c4aac89819a
@HappyHacker123
Copy link
Author

Could you please take a look at this issue @loosla @andrewsomething ? Many thanks :)

@andrewsomething
Copy link
Member

Thanks for flagging this @HappyHacker123 It should be resolved via digitalocean/godo#723

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants