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

google.golang.org/protobuf(generate-protos): Go Workspace #1552

Open
ldez opened this issue Jun 25, 2023 · 1 comment
Open

google.golang.org/protobuf(generate-protos): Go Workspace #1552

ldez opened this issue Jun 25, 2023 · 1 comment

Comments

@ldez
Copy link

ldez commented Jun 25, 2023

What version of protobuf and what language are you using?
Version: all the version
Go

What did you do?

I was working on a problem related to Go Workspace, and I detected a problem inside protobuf-go with Go Workspace.

The following lines, inside the command generate-protos, can't work inside a project that uses Go workspace:

https://github.com/protocolbuffers/protobuf-go/blob/fc47fdd3d3fca5283fa9428ac94cf730236e4ca3/internal/cmd/generate-protos/main.go#L36-L40

Inside a Go workspace, the command go list -m returns all the modules inside the workspace.

As an example of the behavior, you can create a workspace by following this official tutorial.

At any location (at the root of the workspace or inside a module), the command will have this behavior:

$ go list -m -f "{{.Path}}"
golang.org/x/example
example.com/hello
$ cd hello
$ go list -m -f "{{.Path}}"
golang.org/x/example
example.com/hello

What did you expect to see?

I'm not sure how to test this command, I don't find any usage example of this command, if you need I can run it but I will have to ask for an example.

What did you see instead?

I'm not sure how to test this command, I don't find any usage example of this command, if you need I can run it but I will have to ask for an example.

Anything else we should know about your project / environment?

@hoeppi-google
Copy link

generate-protos predates workspaces. It is not meant to be run directly. It is only meant to be run via regenerate.bash/test.bash by people working on the module.

We will look at a fix if someone wants to contribute one.

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

No branches or pull requests

2 participants