我试图编译proto(Ubuntu 18.04)
protoc — go_out=. test.proto
Missing output directives.
我的环境
go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/miki/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/miki/go"
GORACE=""
GOROOT="/usr"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/gcc/x86_64-linux-gnu/8"
GCCGO="/usr/bin/x86_64-linux-gnu-gccgo-8"
CC="x86_64-linux-gnu-gcc-8"
CXX="x86_64-linux-gnu-g++-8"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build089604877=/tmp/go-build -gno-record-gcc-switches -funwind-tables"
protoc-gen-go在我的垃圾箱中
~/go/bin$ ls
gocode gopkgs goreturns protoc-gen-go
我编辑了bashrc
echo $PATH
/home/miki/go/bin
再次摆弄相同的东西。
如何设置输出指令?
答案 0 :(得分:1)
您的原始命令似乎在if ((waitpid(subProc, NULL, NO_OPTIONS) == ERROR_SIG) && errno != ECHILD) {
_exit(EXIT_FAILURE);
};
和--
之间有空格?
答案 1 :(得分:0)
像这样写你的命令:
protoc --go_out=. test.proto
如果 gRPC 服务器需要它:
protoc --go-grpc_out=. test.proto
更多细节,我想告诉你这部分--go_out=。与
有关option go_package="/<folder_name>";
您在 .proto 文件中编写的内容,两者都用于确定输出地址。