モケラ

Tech Sheets

mokelab

Goモジュールで、依存パッケージを追加する

最終更新日:2018-12-31

モジュールとして初期化済みのプロジェクトに依存パッケージを追加するには、Goの基本である `go get` を使用します。

例えば `github.com/gorilla/mux` を追加するには、次のコマンドを実行します。

$ go get github.com/gorilla/mux
$ cat go.mod
module github.com/mokelab-go/myproj

require github.com/gorilla/mux v1.6.2 // indirect

一覧に戻る