Documentation ¶
Overview ¶
Package formatter implements formatters and helper types for err2. See more information from err2.SetFormatter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Decamel is preimplemented and default formatter to produce human // readable error strings from function names. // func CopyFile(..) -> "copy file: file not exists" // ^-------^ -> generated from CopyFile Decamel = &Formatter{DoFmt: str.Decamel} // Noop is preimplemented formatter that does nothing to function name. // func CopyFile(..) -> "CopyFile: file not exists" // ^------^ -> function name as it is: CopyFile Noop = &Formatter{DoFmt: func(i string) string { return i }} )
Functions ¶
This section is empty.
Types ¶
type DoFmt ¶
DoFmt is a helper function type which allows reuse Formatter struct for the implementations.
Click to show internal directories.
Click to hide internal directories.