pretty

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Formatter

func Formatter(x interface{}) (f fmt.Formatter)

Formatter makes a wrapper, f, that will format x as go source with line breaks and tabs. Object f responds to the "%v" formatting verb when both the "#" and " " (space) flags are set, for example:

fmt.Sprintf("%# v", Formatter(x))

If one of these two flags is not set, or any other verb is used, f will format x according to the usual rules of package fmt. In particular, if x satisfies fmt.Formatter, then x.Format will be called.

func Indent

func Indent(s, prefix string) string

Indent inserts prefix at the beginning of each non-empty line of s. The end-of-line marker is NL.

func IndentBytes

func IndentBytes(b, prefix []byte) []byte

IndentBytes inserts prefix at the beginning of each non-empty line of b. The end-of-line marker is NL.

func NewIndentWriter

func NewIndentWriter(w io.Writer, pre ...[]byte) io.Writer

Types

type SortedMap

type SortedMap struct {
	Key   []reflect.Value
	Value []reflect.Value
}

func Sort

func Sort(mapValue reflect.Value) *SortedMap

func (*SortedMap) Len

func (o *SortedMap) Len() int

func (*SortedMap) Less

func (o *SortedMap) Less(i, j int) bool

func (*SortedMap) Swap

func (o *SortedMap) Swap(i, j int)

Jump to

Keyboard shortcuts

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