DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Maxime Guilbert
Maxime Guilbert

Posted on

How to debug : File is not `gofmt`-ed with `-s` (gofmt)

#go

While linting your project, you can have the following error :

pkg/apis/dogs.go:11: File is not `gofmt`-ed with `-s` (gofmt)
Enter fullscreen mode Exit fullscreen mode

To resolve the issue, execute the following command :

gofmt -s -w .
Enter fullscreen mode Exit fullscreen mode

It will simplify the code (with the option -s) and write the result back (with the option -w) on all the current folder (with .).


I hope it will help you! 🍺

Top comments (0)

⬇️ The only reason people scroll to the bottom...

is because they want to read more. Sign up for an account to bookmark, comment, and react to articles that interest you.