logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Format Go Code - Format Go Source Code | Online Free DevTools by Hexmos

Format Go source code with gofmt. Quickly format, simplify, and improve the readability of your Go programs. Free online tool, no registration required.

gofmt

Format Go source code. More information: https://pkg.go.dev/cmd/gofmt.

  • Format a file and display the result to the console:

gofmt {{source.go}}

  • Format a file, overwriting the original file in-place:

gofmt -w {{source.go}}

  • Format a file, and then simplify the code, overwriting the original file:

gofmt -s -w {{source.go}}

  • Print all (including spurious) errors:

gofmt -e {{source.go}}

See Also