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

[Improvement] Use workspace mode to simplify the go.mod #13478

Closed
ahrtr opened this issue Nov 14, 2021 · 4 comments
Closed

[Improvement] Use workspace mode to simplify the go.mod #13478

ahrtr opened this issue Nov 14, 2021 · 4 comments
Labels

Comments

@ahrtr
Copy link
Member

ahrtr commented Nov 14, 2021

Currently there is lots of replace directives in each go.mod file, and most of them are some duplicated items.

In golang 1.18 to be release early next year, a new workspace mode will be added. Please see go/issues/45713. When etcd upgrades the golang version to 1.18, then we can add a go.work in the top level directory, and get all the required replace directives included. Then all the go.mod files do not need to define the replace directives any more. If it's accepted, then I can work on this when the golang version is upgraded to 1.18 in etcd.

On the other hand, I don't think it's good to define lots of replace directives although they are necessary for now. I think we should remove all the replace directives in the go.mod files in all modules in future, so as to remove the build level dependencies on the files on local disk in future. If this is true and accepted, then we do not need the go.work in the future.

I would like to get more feedback on this topic.

cc @mitake

@stale
Copy link

stale bot commented Feb 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 13, 2022
@stale stale bot closed this as completed Mar 12, 2022
@spzala spzala reopened this Apr 27, 2022
@stale stale bot removed the stale label Apr 27, 2022
@ptabor
Copy link
Contributor

ptabor commented Apr 28, 2022

Interesting. But there is also a lot of discussion about not submitting the go.work file into repository as an anti-pattern,
that I would assume is what you are proposing.

https://go.googlesource.com/proposal/+/master/design/45713-workspace.md#preventing-files-from-being-checked-in-to-repositories

@serathius
Copy link
Member

serathius commented Apr 28, 2022

Interesting. But there is also a lot of discussion about not submitting the go.work file into repository as an anti-pattern, that I would assume is what you are proposing.

Yep it was also surprising for me. I even started working on PR on this as I was tired of cding into every package to test it (don't like to use scripts as I like to add some arguments). However apparently K8s plans to do that?

cc @thockin who is more knowledgeable about this.

@stale
Copy link

stale bot commented Jul 31, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 31, 2022
@stale stale bot closed this as completed Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants