Ive got my .proto file with a message that can be exported -
syntax = "proto3";
package domain;
option go_package = "BITBUCKET-REPOSITORY-MANAGEMENT-SERVICE/internal/gRPC/domain";
message Repoistory{
int64 id = 1;
string name = 2;
int64 userId = 3;
bool isPrivate = 4;
}
And another .proto file that import the Repository from the other -
syntax = "proto3";
package service;
option go_package = "BITBUCKET-REPOSITORY-MANAGEMENT-SERVICE/internal/gRPC/service";
import "github.com/MyWorkSpace/lets_Go/BITBUCKET-REPOSITORY-MANAGEMENT-SERVICE/internal/proto-files/domain/repository.proto";
//RepositoryService Definition
service RepositoryService {
rpc add (domain.Repository) returns (AddRepositoryResponse);
}
message AddRepositoryResponse {
domain.Repository addedRepository = 1;
Error error = 2;
}
message Error {
string code = 1;
string message = 2;
}
But unfortunatly, when i try to install it with -
protoc --go_out=. repository-service.proto
i get this error everytime -
github.com/MyWorkSpace/lets_Go/BITBUCKET-REPOSITORY-MANAGEMENT-SERVICE/internal/proto-files/domain/repository.proto: File not found.
repository-service.proto:7:1: Import “github.com/MyWorkSpace/lets_Go/BITBUCKET-REPOSITORY-MANAGEMENT-SERVICE/internal/proto-files/domain/repository.proto” was not found or had errors.
repository-service.proto:15:5: “domain.Repository” is not defined.
repository-service.proto:11:14: “domain.Repository” is not defined.
basically says that it cant find my file. Im really not sure whats wrong because ive checked the path so many times, and still cant see the issue
this is the path of the file im trying to import from
C:\Users\justi\src\github.com\MyWorkSpace\lets_Go\BITBUCKET-REPOSITORY-MANAGEMENT-SERVICE\internal\proto-files\domain