Documentation
¶
Index ¶
- func Dump(values ...interface{})
- func DumpJson(jsonContent string)
- func DumpTo(writer io.Writer, value interface{}, option DumpOption)
- func DumpWithOption(value interface{}, option DumpOption)
- func DumpWithType(values ...interface{})
- func SliceCopy[T any](slice []T) []T
- func SliceDelete[T any](slice []T, index int) (newSlice []T)
- func SliceInsertAfter[T any](slice []T, index int, values ...T) (newSlice []T)
- func SliceInsertBefore[T any](slice []T, index int, values ...T) (newSlice []T)
- type DumpOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Dump ¶
func Dump(values ...interface{})
Dump prints variables `values` to stdout with more manually readable.
func DumpTo ¶
func DumpTo(writer io.Writer, value interface{}, option DumpOption)
DumpTo writes variables `values` as a string in to `writer` with more manually readable
func DumpWithOption ¶
func DumpWithOption(value interface{}, option DumpOption)
DumpWithOption returns variables `values` as a string with more manually readable.
func DumpWithType ¶
func DumpWithType(values ...interface{})
DumpWithType acts like Dump, but with type information. Also see Dump.
func SliceCopy ¶ added in v0.9.10
func SliceCopy[T any](slice []T) []T
SliceCopy does a shallow copy of slice `data` for most commonly used slice type []T.
func SliceDelete ¶ added in v0.9.10
SliceDelete deletes an element at `index` and returns the new slice. It does nothing if the given `index` is invalid.
func SliceInsertAfter ¶ added in v0.9.10
SliceInsertAfter inserts the `values` to the back of `index` and returns a new slice.
func SliceInsertBefore ¶ added in v0.9.10
SliceInsertBefore inserts the `values` to the front of `index` and returns a new slice.
Types ¶
type DumpOption ¶
type DumpOption struct {
WithType bool // WithType specifies dumping content with type information.
ExportedOnly bool // Only dump Exported fields for structs.
}
DumpOption specifies the behavior of function Export.