Coder Social home page Coder Social logo

Comments (6)

seankhliao avatar seankhliao commented on May 29, 2024 1

As they are different types, equality isn't possible (nor is it generally expected of unexported types).

from go.

dolmen avatar dolmen commented on May 29, 2024

@seankhliao My point is that they should not be different types, but instead defined using a type alias. For this reason I'm asking this issue to be reopened.

Cc: @tklauser #57237 (comment)

from go.

gopherbot avatar gopherbot commented on May 29, 2024

Change https://go.dev/cl/581655 mentions this issue: encoding/binary: fix NativeEndian to support == with Little/BigEndian

from go.

dolmen avatar dolmen commented on May 29, 2024

@seankhliao Please review CL581655 which fixes this issue.

from go.

dolmen avatar dolmen commented on May 29, 2024

Cc: @randall77 because #57237 (comment)

from go.

dolmen avatar dolmen commented on May 29, 2024

I realize that my TestEqual in the description is flawed: the bo is of type binary.ByteOrder (an interface) so the comparaison happens at runtime.

However for binary.NativeEndian == binary.BigEndian, the type are resolved at compile time and a mismatch is detected like with binary.LittleEndian == binary.BigEndian:

invalid operation: binary.LittleEndian == binary.BigEndian (mismatched types binary.littleEndian and binary.bigEndian)

So this issue deserved to be closed.

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.