Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gofmt extremely slow to complete

Tags:

go

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?

like image 439
sergserg Avatar asked Feb 27 '14 17:02

sergserg


1 Answers

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.

like image 144
fuz Avatar answered Nov 04 '22 22:11

fuz