Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultWriter = os.Stdout
Functions ¶
func SetEnableColor ¶ added in v0.2.0
func SetEnableColor(enable bool)
func SetForceColor ¶ added in v0.2.0
func SetForceColor(force bool)
Types ¶
type Options ¶
type Options struct {
// print max depth of struct, map, slice, array
MaxDepth uint
// print max array length
MaxArray int
// max property triggering line breaks
MaxPropertyBreakLine int
// show struct method
ShowStructMethod bool
// show type name
ShowTypeName bool
// default color map
ColorMap ColorMap
// coustom color function
Color func(s string, start string, end string) string
// custom prints
Prints []func(v any, opt Options) (string, bool)
}
var Default Options = Options{ MaxDepth: 3, MaxArray: 25, MaxPropertyBreakLine: 10, ColorMap: ColorMap{ Int: [2]string{"34", "39"}, Float: [2]string{"36", "39"}, Complex: [2]string{"35", "39"}, String: [2]string{"32", "39"}, Bool: [2]string{"33", "39"}, Ptr: [2]string{"33", "39"}, Property: [2]string{"39", "39"}, FuncTag: [2]string{"3;33", "39;23"}, Func: [2]string{"3;36", "39;23"}, Chan: [2]string{"31", "39"}, Nil: [2]string{"93", "39"}, Tip: [2]string{"2", "22"}, }, Color: Color, }
Click to show internal directories.
Click to hide internal directories.