Go command. Gofmt formats Go programs. It uses tabs (width = 8) for indentation and blanks for alignment.
Go command. Gofmt formats Go programs. It uses tabs (width = 8) for indentation and blanks for alignment.
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.) By default, gofmt prints the reformatted sources to standard output.