format

package
v0.0.0-...-f8edc06 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2020 License: MIT, BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Format

func Format(
	fset *token.FileSet,
	file *ast.File,
	sourceAdj func(src []byte, indent int) []byte,
	indentAdj int,
	src []byte,
	cfg printer.Config,
) ([]byte, error)

Format formats the given package file originally obtained from src and adjusts the result based on the original source via sourceAdj and indentAdj.

func IsSpace

func IsSpace(b byte) bool

IsSpace reports whether the byte is a space character. IsSpace defines a space as being among the following bytes: ' ', '\t', '\n' and '\r'.

func Parse

func Parse(fset *token.FileSet, filename string, src []byte, fragmentOk bool) (
	file *ast.File,
	sourceAdj func(src []byte, indent int) []byte,
	indentAdj int,
	err error,
)

Parse parses src, which was read from the named file, as a Go source file, declaration, or statement list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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