package format

import "internal/format"

Index

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.

Source Files

format.go

Version
v1.5.4
Published
Apr 12, 2016
Platform
linux/amd64
Imports
6 packages
Last checked
1 minute ago

Tools for package owners.