format

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 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