Search code examples
grpcprotoc

protoc failed to find the import


$ protoc --go_out=module=github.com/redmcme/go-protos:. \
         --go-grpc_out=module=github.com/redmcme/go-protos:. \
        --proto_path ../protos \
          ../protos/*/**
teams.team: File not found.
teams/season.proto:3:1: Import "teams.team" was not found or had errors.
teams/season.proto:22:18: "team.Team" is not defined.

Build command ^

$ ltt ../protos
../protos
├── skyblock
│  └── player.proto
└── teams
   ├── season.proto
   └── team.proto

Directory tree ^

// team.proto
syntax = "proto3";

package teams.team;
option go_package = "github.com/redmcme/go-protos/teams/team";

...

Team proto ^ // season.proto syntax = "proto3";

import "teams.team";

package teams.season;
option go_package = "github.com/redmcme/go-protos/teams/season";

Season proto ^

Does anyone know why protoc failed to find the import


Solution

  • import "teams.team" is wrong way

    the true way is import "team.proto" or import “teams/team.proto”