Colored pretty printer for Go language. Just call pp.Print(). fmt package-like functions are provided. You can also create own instances that do not interfere with the default printer. If you require, you may change the colors (all or some) for syntax highlighting. You may combine any color with a background color and optionally with the bold parameter.
...It can be used as a drop-in replacement to format your Go code, and running gofmt after gofumpt should produce no changes. Some of the Go source files in this repository belong to the Go project. The project includes copies of go/printer and go/doc/comment as of Go 1.19 to ensure consistent formatting independent of what Go version is being used. The added formatting rules are implemented in the format package. Note that vendor directories are skipped unless given as explicit arguments. Similarly, the added rules do not apply to generated Go files unless they are given as explicit arguments.