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

Nothing happens #158

Open
domgolonka opened this issue Jul 8, 2020 · 3 comments
Open

Nothing happens #158

domgolonka opened this issue Jul 8, 2020 · 3 comments
Assignees
Labels

Comments

@domgolonka
Copy link

domgolonka commented Jul 8, 2020

$ ls templates/
enum.txt.tmpl
$ cat templates/enum.txt.tmpl 
This is static text
$ protoc -I. -I=../declarations/postmark-sender --gotemplate_out=debug=true:./test/ ../declarations/postmark-sender/postmark.proto
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
	A future release of golang/protobuf will delete this package,
	which has long been excluded from the compatibility promise.

$ ls test/

I also tried to put the template directory in:
$ protoc -I. -I=../declarations/postmark-sender --gotemplate_out=template_dir=templates,debug=true:test ../declarations/postmark-sender/*.proto
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
A future release of golang/protobuf will delete this package,
which has long been excluded from the compatibility promise.

$ ls test/

I also tried to put the template directory and output directory in:

$ protoc -I=../declarations/postmark-sender --gotemplate_out=template_dir=templates,debug=true,destination_dir=./test/:test ../declarations/postmark-sender/*.proto
WARNING: Package "github.com/golang/protobuf/protoc-gen-go/generator" is deprecated.
	A future release of golang/protobuf will delete this package,
	which has long been excluded from the compatibility promise.

$ ls test

@moul moul added the bug label Jul 8, 2020
@moul
Copy link
Owner

moul commented Jul 8, 2020

Hi @domgolonka,

Your usage is correct, I think this is due to a conflict with another package, can you send me the version of various deps: protoc, protoc-gen-go

How did you install protoc-gen-gotemplate?

@domgolonka
Copy link
Author

$ protoc --version
libprotoc 3.12.3

I did these to install it. I had proto and proto-
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
go get -u moul.io/protoc-gen-gotemplate

@tgorton617
Copy link

Old issue but adding my experience for others:

I encountered a similar problem and realized that by default protoc-gen-gotemplate does not process .proto files that don't contain a service -- I resolved this by adding the "all=true" option as shown in the README. If your .proto file doesn't contain a service, this is probably what's going on.

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

No branches or pull requests

3 participants