formatter

package
v0.0.0-...-ad4ad90 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 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 Sprint

func Sprint(a ...interface{}) string

Sprint is a convenience wrapper for fmt.Sprintf.

Calling Sprint(x, y) is equivalent to fmt.Sprint(Formatter(x), Formatter(y)), but each operand is formatted with "%# v".

Types

This section is empty.

Jump to

Keyboard shortcuts

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