One minute
Goの依存管理ツールのdepのpruneがdeprecatedになった
Goの依存関係管理にはdepがデファクトだし、使っているのだが、
最近 prune
コマンドがdeprecatedされた。
depのprune
$ dep prune -v
このコマンドは、ensure
で山盛り追加されるvendorから、使用していないpackageを除外してくれて、レポジトリが軽くなるので気に入ってよく使っていた。
Makefileにもだいたい以下のように書いていた。
update:
dep ensure -update -v && dep prune -v
実行時に警告が
多分0.4からこういう警告が出るようになった。
Pruning is now performed automatically by dep ensure.
Set prune settings in Gopkg.toml and it it will be applied when running ensure.
This command currently still prunes as it always has, to ease the transition.
However, it will be removed in a future version of dep.
Now is the time to update your Gopkg.toml and remove `dep prune` from any scripts.
意訳
dep ensureで自動でできるようになったよ。
そのためにはtomlに設定を追加してね。
このコマンドは将来消すよ。
君のスクリプトから dep prune を今すぐ消すんだ!
対応
- dep pruneを消す
- Gopkg.toml の先頭に以下を追加する。
[prune]
non-go = true
unused-packages=true
go-tests=true
これでensure時に自動prune! dep document
ちなみに、このdepのドキュメントは多分、Facebookのdocusaurus製。
Read other posts