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

Make protoc-gen-swagger build on 1.11 #1044

Closed
sumabn opened this issue Sep 17, 2019 · 4 comments
Closed

Make protoc-gen-swagger build on 1.11 #1044

sumabn opened this issue Sep 17, 2019 · 4 comments

Comments

@sumabn
Copy link

sumabn commented Sep 17, 2019

Tried to run go get inside dockerfile
RUN go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger

and got this error.

src/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/genswagger/generator.go:71:9: undefined: strings.ReplaceAll
The command '/bin/sh -c go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger' returned a non-zero code: 2

@johanbrandhorst
Copy link
Collaborator

https://golang.org/pkg/strings/#ReplaceAll was added in go 1.12, which was only ~8 months ago, so we may want to support at least go 1.11. To fix this right now, you could try upgrading to go 1.12 or go 1.13, but I think we should make this work in 1.11.

@johanbrandhorst johanbrandhorst changed the title go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger is returning error code 2 Make protoc-gen-swagger build on 1.11 Sep 17, 2019
@johanbrandhorst
Copy link
Collaborator

What can I do to help you contribute a fix for this?

@achew22
Copy link
Collaborator

achew22 commented Sep 17, 2019

To expand on @johanbrandhorst, I think we would be happy to accept a patch to make the code compatible with 1.11, but the current group of maintainers is not going to write that. We only support two versions back in golang, but will accept compatibility patches into head.

@sumabn
Copy link
Author

sumabn commented Sep 19, 2019

upgraded go version to 1.13 in docker. Now docker build is going through.

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

No branches or pull requests

3 participants