기본 콘텐츠로 건너뛰기

4월, 2024의 게시물 표시

golang .protobuf go_package 오류 나는 문제.

1.golang용 protocol buffer 관련 모듈은 다운로드 받았음 go get -d -u google.golang.org/protobuf go install github.com/golang/protobuf/protoc-gen-go 2. pitaya 샘플 .proto 파일 생성을 시도 했으나, 아래 오류가 발생하면서 빌드 실패함 D:\pitaya>protoc --proto_path=examples\demo\worker\protos --go_out=plugins=grpc:. examples\demo\worker\protos\*.proto protoc-gen-go: unable to determine Go import path for "arg.proto" Please specify either:         • a "go_package" option in the .proto source file, or         • a "M" argument on the command line. See https://developers.google.com/protocol-buffers/docs/reference/go-generated#package for more information. --go_out: protoc-gen-go: Plugin failed with status code 1. D:\pitaya> stackoverflow 등 참고해도 비슷하지만 다른 내용들 뿐. .proto 파일내에 option go_package = "../protos_gen"; 내용 추가하여 빌드하니 잘됨. 3.기존 소스 -------------------------------- syntax = "proto3"; package protos; message Arg {   string msg = 1; } 4.신규 소스 -------------------------------- syntax