Documentation ¶
Index ¶
- func DeepCopy[T any](src any) (T, error)
- func DeepCopyAny(dst, src any) error
- func ReadBytes[T any](b []byte) (T, error)
- func ReadBytesAny(b []byte, v any) error
- func ReadFile[T any](filename string) (T, error)
- func ReadFileAny(filename string, v any) error
- func ReadReader[T any](r io.Reader) (T, error)
- func ReadReaderAny(r io.Reader, v any) error
- func WriteBytes(v any) ([]byte, error)
- func WriteFile(filename string, v any) error
- func WriteWriter(w io.Writer, v any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepCopy ¶
DeepCopy clone object. can clone without same type
Example:
type Foo struct { Name string Value int } type Bar struct { Name string Value int } foo := &Foo { "Jason", 100} bar, err := DeepCopy[Bar](foo) fmt.Printf("%+v\n", bar)
func DeepCopyAny ¶
DeepCopyAny clone object to dst. can clone without same type
func ReadFileAny ¶
ReadFileAny read struct from gob stream file
func ReadReaderAny ¶
ReadReaderAny read struct from reader
func WriteBytes ¶
WriteBytes write struct to gob stream bytes
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.