0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

gRPCのインターフェースドキュメント自動生成に苦しんだので記事化

Last updated at Posted at 2023-04-18

gRPCのインターフェースドキュメント自動生成に苦しんだので記事化

今回の容疑者

protoc --doc_out=. --doc_opt=html,index.html file.proto

上記コマンドで自動生成出来るはずだった。






しかし、出来なかった。
error内容

protoc-gen-doc: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable      
--doc_out: protoc-gen-doc: Plugin failed with status code 1.




現場に居るパッケージは以下の通り。
go.mod
github.com/pseudomuto/protoc-gen-doc v1.5.1

こちらのコマンドは実行済だ。


go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc

# 実行結果
# module github.com/golang/protobuf is deprecated: Use the "google.golang.org/protobuf" module instead.



わけがわからない。

ひたすら記事を探し(公式とか海外のは出来るだけ避けた(あかん))...

# 実行
go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest

#go: downloading github.com/envoyproxy/protoc-gen-validate v0.3.0-java
#go: downloading google.golang.org/genproto v0.0.0-20210917145530-b395a37504d4
#go: downloading google.golang.org/protobuf v1.27.1
#go: downloading github.com/google/uuid v1.1.2
#go: downloading golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9

# 実行
protoc -I. --doc_out=. --doc_opt=html,index.html *.proto

( ゚д゚)ハッ!デケタ!!!

ありがとう、どこかの(Zenn)ぱんださん
image.png

Conclusion

  • 1時間失いました。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?