Giter VIP home page Giter VIP logo

Comments (7)

PumpkinSeed avatar PumpkinSeed commented on August 15, 2024 1

@qzyse2017 Can't agree, it's just a temporary solution. What if we have 300 nested field? It should be handled inside the library, if the nested field is nil, then reflect.New with the type of the field.

from copier.

PumpkinSeed avatar PumpkinSeed commented on August 15, 2024

Possible it's trying to call the reflectValue.Elem() on a nil reflect.Value, so it won't have an exact Elem(). But correct me if I'm not right.

from copier.

bazaglia avatar bazaglia commented on August 15, 2024

@sudo-suhas have you found any fix for this?

from copier.

sudo-suhas avatar sudo-suhas commented on August 15, 2024

No.

from copier.

prism4time avatar prism4time commented on August 15, 2024
b.nested = &nested{}

initialize the pointer can avoid panic.

https://play.golang.org/p/o4m2S_pqJPH

from copier.

georgysavva avatar georgysavva commented on August 15, 2024

Hey. Any update on this? Is fix coming to the library?

from copier.

math-nao avatar math-nao commented on August 15, 2024

This example uses unexported anonymous fields. Unexported fields cannot be copied to.
PR #72 adds support for exported anonymous fields and avoid panic in case of anonymous fields.

from copier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.