Documentation
¶
Overview ¶
Package format exposes gofumpt's formatting in an API similar to go/format. In general, the APIs are only guaranteed to work well when the input source is in canonical gofmt format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// LangVersion is the Go version a piece of code is written in.
// The version is used to decide whether to apply formatting
// rules which require new language features.
// When inside a Go module, LangVersion should typically be:
//
// go mod edit -json | jq -r '.Go'
LangVersion string
// ModulePath corresponds to the Go module path which contains the source
// code being formatted. When inside a Go module, ModulePath should be:
//
// go mod edit -json | jq -r '.Module.Path'
//
// ModulePath is used for formatting decisions like what import paths are
// considered to be not part of the standard library. When empty, the source
// is formatted as if it weren't inside a module.
ModulePath string
// ExtraRules enables extra formatting rules, such as grouping function
// parameters with repeated types together.
ExtraRules bool
}
Options is the set of formatting options which affect gofumpt.
Click to show internal directories.
Click to hide internal directories.