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

protoc option "--go_opt=paths=source_relative" not respected #498

Closed
emicklei opened this issue Jul 16, 2021 · 3 comments
Closed

protoc option "--go_opt=paths=source_relative" not respected #498

emicklei opened this issue Jul 16, 2021 · 3 comments
Labels
Go Go language support Question Question about the library

Comments

@emicklei
Copy link

hi,

i am using libprotoc 3.17.1 with the following command to generate Go files:

protoc \
    -I . \
    -I ~/go/pkg/mod/github.com/envoyproxy/protoc-gen-validate@v0.6.1 \
    --go_out=. --go_opt=paths=source_relative \
    --go-grpc_out=. --go-grpc_opt=paths=source_relative \
    --validate_out="lang=go:clock" \
    clock/clock.proto

I expect the clock_grpc.pb.bo to appear in the clock directory but it is generated with the full go_package value as path in the directory clock

@rodaine rodaine added the Go Go language support label Jul 16, 2021
@rodaine
Copy link
Member

rodaine commented Jul 16, 2021

Hey! Add ,paths=source_relative to the validate_out flag and it'll put the file in the right place:

--validate_out="lang=go,paths=source_relative:clock"

@rodaine rodaine added the Question Question about the library label Jul 16, 2021
@emicklei
Copy link
Author

thx, the paths=source_relative was mentioned in the docs but I tried --paths=source_relative as a flag on protoc. Your example will improve that doc.

@mztnnrt
Copy link
Contributor

mztnnrt commented Jan 27, 2023

@rodaine @emicklei

but I tried --paths=source_relative as a flag on protoc

me,too. If you are ok, place check below.

elliotmjackson added a commit that referenced this issue Mar 20, 2023
Add sample about `source_relative`, If used to it, they'll understand,
but if beginner, it's hard to know.

### Background

-
#498 (comment)

Co-authored-by: Elliot Jackson <13633636+elliotmjackson@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Go Go language support Question Question about the library
Projects
None yet
Development

No branches or pull requests

3 participants