Comments (3)
The test case on the Go Playground: https://play.golang.org/p/aRqYwob8YM6
from deepcopy.
The proposed fix is not the right solution, because the problem is not about the original value but about the output of .DeepCopy()
.
Here is the correct fix:
if original.CanInterface() {
if copier, ok := original.Interface().(Interface); ok {
out := copier.DeepCopy()
cpy.Set(reflect.ValueOf(&out).Elem())
return
}
}
from deepcopy.
have you verified your fix? it doesn't work.
the problem here is copier could be nil, thus copier.Deepcopy will panic.
it seems this author forgot the project now.
from deepcopy.
Related Issues (15)
- Format strings in test file are invalid HOT 1
- Could Copy(src, dst) be supported? HOT 1
- DeepCopy interface implementation doesn't improve performance
- Not an issue, this repo just saved my day.
- Custom copy HOT 7
- Does this repo still being maintained? HOT 2
- Can you provide the performance test data
- panic: reflect: slice index out of range HOT 6
- error can not be copyed HOT 1
- facing issue while call deepcopy HOT 2
- There are cases we cannot deepcopy HOT 4
- Make public copyRecursive(original, cpy reflect.Value) HOT 2
- copy unexported field HOT 2
- Map keys aren't deep-copied HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepcopy.