barkimedes / go-deepcopy

A Golang package for doing a deep copy for (just about) anything
MIT License
140 stars 28 forks source link

feat: register new copiers #4

Open TMaYaD opened 2 years ago

TMaYaD commented 2 years ago

We needed to be able to copy structs with lists of functions. For our use case shallow copy of functions is acceptable.

This PR, along with

    deepcopy.Register(reflect.Func, func(x interface{}, ptrs map[uintptr]interface{}) (interface{}, error) {
        return x, nil
    })

handles the scenario well.