The current implementation of protoc-gen-go supports module flag, that (and that flag is supported even in new APIv2 since v1.21.0). The current implementation of protoc-gen-goclay plugin has no support for module flag:
Error parsing flags: Cannot set flag module=github.com/foo/bar: no such flag -module
Using this flag helps to enhance workflow with generated files due to generation in the root directory with a relative path (i.e. github.com/foo/bar/baz/my.proto will be generated as baz/my.pb.go with --go_out=module=github.com/foo/bar).
With the support of this flag, it'll be much easier to work in modules and overall with generated files.
The current implementation of
protoc-gen-go
supportsmodule
flag, that (and that flag is supported even in new APIv2 sincev1.21.0
). The current implementation ofprotoc-gen-goclay
plugin has no support formodule
flag:Using this flag helps to enhance workflow with generated files due to generation in the root directory with a relative path (i.e.
github.com/foo/bar/baz/my.proto
will be generated asbaz/my.pb.go
with--go_out=module=github.com/foo/bar
).With the support of this flag, it'll be much easier to work in modules and overall with generated files.