Protobuf: modules: how can we use protoc-gen-go now?

Created on 27 Aug 2018  路  1Comment  路  Source: golang/protobuf

Now that Go 1.11 is officially out, I think we should revisit the UX around using protoc-gen-go. How do we deal with not having a GOPATH variable defined? What's now the best way to define an option go_package? How does this change how protoc-gen-go is invoked in the command line?

Most helpful comment

I don't think anything changes.

My recommendation is to always have an option go_package containing the full import path of the Go package in every .proto file, and to always include the paths=source_relative generator option. The former ensures imports of the package use the right import path, and the latter puts your output files where you (probably) expect them.

>All comments

I don't think anything changes.

My recommendation is to always have an option go_package containing the full import path of the Go package in every .proto file, and to always include the paths=source_relative generator option. The former ensures imports of the package use the right import path, and the latter puts your output files where you (probably) expect them.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

junghoahnsc picture junghoahnsc  路  5Comments

parkr picture parkr  路  5Comments

hxzqlh picture hxzqlh  路  5Comments

seungryulchoisc picture seungryulchoisc  路  3Comments

khadgarmage picture khadgarmage  路  3Comments