formatutil

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RearrangeFuncs

func RearrangeFuncs(src []byte, filename ...string) ([]byte, error)

RearrangeFuncs rearranges functions in src.

func SourceEx

func SourceEx(src []byte, class bool, filename ...string) (formatted []byte, err error)

SourceEx formats src in canonical xgofmt style and returns the result or an (I/O or syntax) error. src is expected to be a syntactically correct XGo source file, or a list of XGo declarations or statements.

If src is a partial source file, the leading and trailing space of src is applied to the result (such that it has the same leading and trailing space as src), and the result is indented by the same amount as the first line of src containing code. Imports are not sorted for partial source files.

Types

This section is empty.

Jump to

Keyboard shortcuts

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