2
2

Golandでファイルとそのtestファイルをまとめる設定[Go,InteliJ]

Last updated at Posted at 2024-09-27

インターン先のメンターさんに、Golandで下の画像のようにgoのファイルとそのテストファイルをまとめる方法を教えていただいたので、そちらを共有したいと思います。

スクリーンショット 2024-09-27 14.58.29.png

Golandでの設定

左の方にある下の画像に写っている3点リーダを探します。
スクリーンショット 2024-09-27 14.59.27.png

そうすると下のような欄が出てくるので、File Nestingを選択します。
スクリーンショット 2024-09-27 15.00.49.png

下の画像のようにファイルの拡張子とその派生名のようなものが写った画面になると思います。
スクリーンショット 2024-09-27 15.01.46.png

左のParent File Suffix.goになっているところの、Child File Suffix_test.goを追加してください。

_test.go

もし前にファイル名が既に記載されている場合は

;_test.go

を追記してください。

2
2
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
2
2