Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lazy ¶
Lazy returns an fmt.Stringer which returns the string returned by the given function.
As this function is called only when the Stringer's String() function is called, this can be used in loggers to postpone expensive tasks.
func LazyW ¶
LazyW returns an fmt.Stringer which returns the string written by the given function.
The io.Writer given to the function is a *bytes.Buffer cached by a sync.Pool.
As this function is called only when the Stringer's String() function is called, this can be used in loggers to postpone expensive tasks.
Types ¶
type StringerFunc ¶
type StringerFunc func() string
StringerFunc is a function which returns a string.
func (StringerFunc) String ¶
func (f StringerFunc) String() string
Click to show internal directories.
Click to hide internal directories.