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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add version information at compile-time #1803

Closed
guodongq opened this issue Nov 9, 2020 · 2 comments
Closed

add version information at compile-time #1803

guodongq opened this issue Nov 9, 2020 · 2 comments

Comments

@guodongq
Copy link

guodongq commented Nov 9, 2020

馃悰 Bug Report

I want to add version information at compile-time, but it does not take effect when using the following command:

$ go get -ldflags="-X github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway.version=v2.0.1" github.com/grpc-ecosystem/grpc-gateway/v2/[email protected]

any comments?

@johanbrandhorst
Copy link
Collaborator

You can see the logic we're using for the versioning here: https://github.com/grpc-ecosystem/grpc-gateway/blob/master/protoc-gen-grpc-gateway/main.go#L39-L43. If you download one of the precompiled versions from the releases it will have the version set.

@guodongq
Copy link
Author

guodongq commented Nov 9, 2020

thx, it works when I use the command as follows:

go get -ldflags="-X 'main.version=v2.0.1'" github.com/grpc-ecosystem/grpc-gateway/v2/[email protected]

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