Skip to content

Latest commit

 

History

History
53 lines (41 loc) · 664 Bytes

readme.md

File metadata and controls

53 lines (41 loc) · 664 Bytes

deepcopy

import

go get github.com/codingpot/the-petty/deepcopy

import github.com/codingpot/the-petty/deepcopy

how to use

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)
}

supported

  • pointer
  • primitive type
  • slice
  • array
  • channel
  • interface
  • function
  • unexported field

todos

  • recover
  • explitct GC
  • unexported field
  • interface
  • function