Help us shape the future of Go! Take the 2026 Go Developer Survey

format

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoContextAvailable opType
	ObjectLiteral
	ForExpression
	TernaryExpression
)

Variables

This section is empty.

Functions

func Source

func Source(source string, opts Options) string

Source returns the formatted source code, optionally standardizing object literals to always be in key = value format, for consistency and better indentation.

Types

type FormatCmd

type FormatCmd struct {
	Check     bool
	Recursive bool
	Opts      Options
}

func (*FormatCmd) Execute

func (f *FormatCmd) Execute(args []string) error

type Options

type Options struct {
	StandardizeObjectLiterals bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL