sergserg
sergserg

Reputation: 22254

gofmt extremely slow to complete

I'm on an iMac 27'' late 2013 model and I want to run the gofmt tool against my package.

I'm calling it like so:

iMacs-Image:sergiotapia ~/smitego $ gofmt

And it's frozen there forever, never completing. Any suggestions?

Upvotes: 7

Views: 2940

Answers (1)

fuz
fuz

Reputation: 93004

You're calling it incorrectly. gofmt expects a source file on its standard input and outputs formatted code on standard output. Use go fmt (with a space) inside the directory of the package you want to format to format the code inside a package.

Upvotes: 14

Related Questions