I am trying to have protoc-generated server interface and client implementation in separate packages
The header part of my .proto files is the following:
syntax = "proto3";
option go_package = "github.com/<username>/<myservice>/pkg/grpc";
And I am using this command to generate .go files:
protoc --go_out=. --go_opt=paths=source_relative\
--go-grpc_out=. --go-grpc_opt=paths=source_relative\
pkg/grpc/*.proto
It generates pkg/grpc/<name>.pb.go files containing models and pkg/grpc/<name>_grpc.pb.go files containing server interface and client implementation (picture)
But I want the server to go to, say internal/pkg/grpc/, while the client and the models remaining inside pkg/grpc/, and the server correctly importing the models.
Versions:
protocversion islibprotoc 3.19.0protoc-gen-go-grpcversion isprotoc-gen-go-grpc 1.1.0protoc-gen-goversion isprotoc-gen-go v1.27.1
I am new to golang and protobuf, so if whatever I am asking happens to be bad practice, feel free to point me to the idiomatic one

It seems there isn't an option to do this. The plugin
protoc-gen-go-grpcwrites the output service code to the same file with_grpc.pb.gosuffix, where "service" includes both client and server code.You can only define different output paths per plugin:
protoc-gen-gosupports--go_outand--go_optflagsprotoc-gen-go-grpcsupports--go-grpc_outand--go-grpc_optflags