• Solemarc@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    8 months ago

    As far as I was aware Go didn’t have enums and this

    const()
    

    Pattern is just a weird thing people do because it behaves like an enum?

    • Ethan@programming.dev
      link
      fedilink
      English
      arrow-up
      3
      ·
      8 months ago

      You are correct, Go doesn’t have enums. The const thing is a widely accepted pattern for approximating enums.