blob: 5851fe2d99bb7bddba97499fe21981a6b2670b46 [file] [log] [blame]
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
Gofmt formats Go programs.
Without an explicit path, it processes the standard input. Given a file,
it operates on that file; given a directory, it operates on all .go files in
that directory, recursively. (Files starting with a period are ignored.)
gofmt [flags] [path ...]
The flags are:
just list files whose formatting differs from gofmt's; generate no other output
unless -w is also set.
if set, overwrite each input file with its output.
align with spaces instead of tabs.
tab width in spaces.
align columns.
Debugging flags:
print parse trace.
print comments; if false, all comments are elided from the output.
package documentation