GithubHelp home page GithubHelp logo

Comments (6)

ugorji avatar ugorji commented on July 17, 2024

what failure did you get?

from go.

aarondl avatar aarondl commented on July 17, 2024

reflect: NumField of non-struct type
This is from the reflect package's type.go line# 645.

from go.

ugorji avatar ugorji commented on July 17, 2024

Good catch. I updated the issue.

It doesn't cause a panic - the panic is caused because your code called panic.

But yes, an embedded pointer is not supported.

I'm looking into it now. Great catch. Much appreciated.

from go.

aarondl avatar aarondl commented on July 17, 2024

Wow ultra fail. Missed the correct button. I meant to say that I didn't say that in panic'd just that it failed to work as expected :)

from go.

ugorji avatar ugorji commented on July 17, 2024

Not a quick fix.

The code doesn't work for any embedded pointers.

I've fixed your use case but want to ensure all the different variants work i.e

type Z int 
type A struct {
    AnInt int
}

type B struct {
    *Z
    *A
    MoreInt int
}

Also, FYI, we don't encode/decode private (unexported) fields. So they have to be AnInt, and MoreInt.

I'd probably get the fix out within 24-48 hours. I'd fix now, let it soak, and sleep over it before submitting, make sure I'm not missing anything.

from go.

ugorji avatar ugorji commented on July 17, 2024

Fixed by commit 8eedb40

from go.

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.