从微开始,一切正常。make
我没有 VisualStudio ,但我有巧克力(不知道是否可能是问题)
micro new
我用这样的方式引导服务。
λ micro new my.test
Creating service my.test
.
├── micro.mu
├── main.go
├── generate.go
├── handler
│ └── my.test.go
├── proto
│ └── my.test.proto
├── Dockerfile
├── Makefile
├── README.md
├── .gitignore
└── go.mod
download protoc zip packages (protoc-$VERSION-$PLATFORM.zip) and install:
visit https://github.com/protocolbuffers/protobuf/releases
download protobuf for micro:
go get -u github.com/golang/protobuf/proto
go get -u github.com/golang/protobuf/protoc-gen-go
go get github.com/micro/micro/v3/cmd/protoc-gen-micro
compile the proto file my.test.proto:
cd my.test
make proto
安装依赖项,一切都很好。然后我搬到 my.test 并在出现make proto
此错误后
protoc --proto_path=. --micro_out=. --go_out=:. proto/proto.test.proto
proto/proto.test.proto:7:14: Expected "{".
make: *** [Makefile:16: proto] Error 1
我有所有依赖项,我的 PATH 很好,但我不知道问题出在哪里。
编辑:这是我的原型,由 micro 方便地生成
syntax = "proto3";
package proto.test;
option go_package = "./proto;proto.test";
service Proto.Test {
rpc Call(Request) returns (Response) {}
rpc Stream(StreamingRequest) returns (stream StreamingResponse) {}
rpc PingPong(stream Ping) returns (stream Pong) {}
}
message Message {
string say = 1;
}
message Request {
string name = 1;
}
message Response {
string msg = 1;
}
message StreamingRequest {
int64 count = 1;
}
message StreamingResponse {
int64 count = 1;
}
message Ping {
int64 stroke = 1;
}
message Pong {
int64 stroke = 1;
}