---
name: "gofmt"
section: "1"
platform: "linux"
package: "gcc-go"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/gofmt"
---

# gofmt(1)

format Go code

## NAME

gofmt - format Go code

## SYNOPSIS

**gofmt** \[*flags*\] \[*path*\]...

## DESCRIPTION

A tool for formatting Go source code.  For full documentation run **gofmt -help** or see **http://golang.org/cmd/gofmt**.

## SEE ALSO

[*go*(1)](/go/1.md)
