Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

Use a go.work for examples instead of go.mod's replace directive #846

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sylr
Copy link
Contributor

@sylr sylr commented Jul 14, 2024

Go workspaces are easier to override.

@sylr sylr force-pushed the go-workspace branch 2 times, most recently from bd5f415 to 56d4b0f Compare July 14, 2024 12:32
@sylr sylr marked this pull request as ready for review July 14, 2024 12:45
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
@joerdav
Copy link
Collaborator

joerdav commented Jul 14, 2024

Potentially my understanding is wrong here, but I was under the impression that it's not generally advisable to commit a go.work file.

@sylr
Copy link
Contributor Author

sylr commented Jul 14, 2024

I wouldn't do it a project's root but I think it is acceptable for an examples/ sub folder.

@a-h
Copy link
Owner

a-h commented Aug 1, 2024

Sorry about the delayed response on this one.

I dislike that the examples have a replace directive in them, because it means you can't copy/paste the folder outside of the directory structure and use it, which I think is confusing when you're trying to build on top of an example.

It sounds like a go.work file is a good way to avoid this, but also that the general idea is that they shouldn't be checked in.

I'm not an expert on Go workspaces, and don't recall using them myself. I guess they allow you to open multiple Go projects at once or something?

So, the reasons we haven't merged this seem to be that @joerdav and I don't currently have the knowledge and experience to make a call on this, so we need to do that before we can make a call on it, hence the delay.

@a-h a-h added help wanted Extra attention is needed NeedsDecision Issue needs some more discussion so a decision can be made labels Aug 1, 2024
@joerdav
Copy link
Collaborator

joerdav commented Aug 1, 2024

The use case I've seen for workspaces is very different than this, like for using a local version of a dependency without editing the go.mod

And most projects I've seen have it gitignored, but if this works then maybe it's a correct use case too!

@sylr
Copy link
Contributor Author

sylr commented Aug 1, 2024

If you want an example of checked in go.work you have https://github.com/kubernetes-sigs/kustomize/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed NeedsDecision Issue needs some more discussion so a decision can be made
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants