protoc-gen-gorm icon indicating copy to clipboard operation
protoc-gen-gorm copied to clipboard

get "protoc-gen-gogo: error:inconsistent package import paths" errors

Open floating-yuan opened this issue 3 years ago • 0 comments

project structure: BC350AA55EFD7786F986541542D4A686

shop/v1/shop.proto: 63103E5C561DD1CAA53D0785AE0B31A2

shop/v1/service/shop.proto: CDFBE1E8BAE14E1B25FD67A30DA038B6

protoc cmd:

protoc --proto_path=. \
        --proto_path=./third_party \
         --go_out=paths=source_relative:. \
     --gorm_out=paths=source_relative:. \
     --validate_out=paths=source_relative,lang=go:. \
         --go-http_out=paths=source_relative:. \
         --go-grpc_out=paths=source_relative:. \
   --openapiv2_out . \
    --openapiv2_opt logtostderr=true \
    --openapiv2_opt json_names_for_fields=false \
        $(shell find api/shop -name *.proto)

will get this errors:

protoc-gen-gogo: error:inconsistent package import paths: "my.example-domain.com/api/shop/v1", "my.example-domain.com/api/shop/v1/service"
--gorm_out: protoc-gen-gorm: Plugin failed with status code 1.

if delete --gorm_out=paths=source_relative:. \ this line in protoc cmd. it will works fine.

floating-yuan avatar Dec 07 '21 13:12 floating-yuan