go get github.com/codingpot/the-petty/deepcopy
import github.com/codingpot/the-petty/deepcopy
import (
"fmt"
"github.com/codingpot/the-petty/deepcopy"
)
type Point struct {
X int
Y int
}
func main() {
a := Point{
X: 4,
Y: 4,
}
b, err := deepcopy.Copy(a)
if err != nil {
log.Fatal(err)
}
fmt.Println(b)
}
- pointer
- primitive type
- slice
- array
- channel
- interface
- function
- unexported field
- recover
- explitct GC
- unexported field
- interface
- function