windows下报错:–proto_path passed empty directory name. (Use “.” for current directory.)
在按proto文件生成go文件时报错:–proto_path passed empty directory name. (Use “.” for current directory.)
原因:路径问题
在windows下需要填写绝对路径 即可生成
将相对路径改为绝对路径即可
例:
PS D:\Go_WorkSpace\server\proto> protoc -I=. --go_out=source_relative:gen/go trip.proto
--proto_path passed empty directory name. (Use "." for current directory.)
上述报错方式的相对路径在linux上可用
改为:
PS D:\Go_WorkSpace\server\proto> protoc -I=D:\Go_WorkSpace\server\proto --go_out=paths=source_relative:gen/go trip.proto
即可生成服务接口所需要的go文件