LoginSignup
11
3

More than 1 year has passed since last update.

go.mod file not found in current directory or any parent directoryと言われたら公式チュートリアルを見よう

Posted at

はじめに

最近Go言語を触り初めて、よくgo.modがないよと怒られるので、備忘録として残しておきます。

もしくは公式のチュートリアルを参照しましょう。

結論

go mod initを実行しよう

以下を実行してgo.modファイルを作成しましょう。

% go mod init <project_name>

go getで使用するgitリポジトリを指定しよう

以下のように外部のリポジトリを使用する場合は指定しましょう。下のリポジトリは例です。

% go get github.com/rwcarlsen/goexif/exif
11
3
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
11
3