format

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(dir string, args ...string) error

Run formats Gunk files to be canonically formatted.

func Source

func Source(src []byte) ([]byte, error)

Source canonically formats a single Gunk file, returning the result and any error encountered.

Types

type Formatter added in v0.10.0

type Formatter struct {
	Config *config.Config
	// contains filtered or unexported fields
}

Formatter is a struct that holds the state of the formatter. A new formatter should be initialized when using different config.

func New added in v0.10.0

func New(cfg *config.Config) (*Formatter, error)

New creates a new instance of Formatter.

func (*Formatter) Source added in v0.10.0

func (f *Formatter) Source(src []byte) ([]byte, error)

Source canonically formats a single Gunk file using the formatter's config, returning the result and any error encountered.

Jump to

Keyboard shortcuts

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