Go微服务报错protoc-gen-go: unable to determine Go import path for
生活随笔
收集整理的這篇文章主要介紹了
Go微服务报错protoc-gen-go: unable to determine Go import path for
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
問題?
$ protoc --go_out=./ hello.proto protoc-gen-go: unable to determine Go import path for "hello.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.方法?
syntax = "proto3";option go_package="./;hello"; package hello;message Hello {string name = 1;int32 age = 2;string addr = 3;} 添加 option go_package="./;hello";說明?
option go_package = "path;name";path 表示生成的go文件的存放地址,會自動生成目錄的。 name 表示生成的go文件所屬的包名?
總結
以上是生活随笔為你收集整理的Go微服务报错protoc-gen-go: unable to determine Go import path for的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Go的协程与Swoole的协程的区别:环
- 下一篇: 网贷逾期多久放弃催收 对方起诉时必须归