github / proto-gen-go

A 'go generate' script to generate Go files from .proto interfaces
22 stars 7 forks source link

Use install > get as it will stop building bins #9

Closed marwan-at-work closed 2 years ago

marwan-at-work commented 2 years ago

Though at this point we still use Go 1.17, 1.18 release notes say:

go get no longer builds or installs packages in module-aware mode

Ref: https://tip.golang.org/doc/go1.18

Also, I've never done go install <mod1> <mod2> but trying it locally, I need to make sure to run both of them separately otherwise Go thinks <mod2> must belong to <mod1>

$ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest github.com/twitchtv/twirp/protoc-gen-twirp@latest
go: finding module for package github.com/twitchtv/twirp/protoc-gen-twirp
go: finding module for package github.com/pkg/errors
go: found github.com/pkg/errors in github.com/pkg/errors v0.9.1
package github.com/twitchtv/twirp/protoc-gen-twirp provided by module github.com/twitchtv/twirp@v8.1.1+incompatible
    All packages must be provided by the same module (google.golang.org/protobuf@v1.27.1)

vs

$ go install google.golang.org/protobuf/cmd/protoc-gen-go@latest && go install github.com/twitchtv/twirp/protoc-gen-twirp@latest
go: finding module for package github.com/pkg/errors
go: finding module for package google.golang.org/protobuf/types/pluginpb
go: finding module for package google.golang.org/protobuf/proto
go: finding module for package google.golang.org/protobuf/types/descriptorpb
go: found github.com/pkg/errors in github.com/pkg/errors v0.9.1
go: found google.golang.org/protobuf/proto in google.golang.org/protobuf v1.27.1
go: found google.golang.org/protobuf/types/descriptorpb in google.golang.org/protobuf v1.27.1
go: found google.golang.org/protobuf/types/pluginpb in google.golang.org/protobuf v1.27.1