goclonestruct

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2024 License: MIT Imports: 5 Imported by: 0

README

go-clone-struct

Just clone struct lazy way in Go with encoding/gob

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneUsingGob

func CloneUsingGob[S any, D any](source *S, destination *D) error

CloneUsingGob clones the given source struct to the given destination struct using encoding/gob. It returns an error if either the source or destination is nil, or if there is an error during encoding or decoding.

func CloneUsingJson

func CloneUsingJson[S any, D any](source *S, destination *D) error

CloneUsingJson clones the given source struct to the given destination struct using encoding/json. It returns an error if either the source or destination is nil, or if there is an error during encoding or decoding.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL