16
11

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 5 years have passed since last update.

Go言語: ディレクトリ内の全ファイルをフォーマットする方法

Last updated at Posted at 2013-12-11

特定のディレクトリの中にある、ファイル全てにフォーマットをかけて、ソースコードを整えるコマンド

gofmt -s -w /path/to/dir

-s はSimplify Mode。冗長なコードを単純化してくれるらしい。
-w は整形したコードで元ファイルを上書きする。

また、以下のコマンドでも同様のことができる

go fmt ./...
16
11
1

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
16
11

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?