Use a go.work for examples instead of go.mod's replace directive#846
Use a go.work for examples instead of go.mod's replace directive#846
Conversation
bd5f415 to
56d4b0f
Compare
Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
|
Potentially my understanding is wrong here, but I was under the impression that it's not generally advisable to commit a go.work file. |
|
I wouldn't do it a project's root but I think it is acceptable for an examples/ sub folder. |
|
Sorry about the delayed response on this one. I dislike that the examples have a It sounds like a 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. |
|
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! |
|
If you want an example of checked in go.work you have https://github.com/kubernetes-sigs/kustomize/. |
|
If it helps It is advised against here https://go.dev/ref/mod#go-work-file after a lot of discussion here golang/go#53502 |
Go workspaces are easier to override.