• Solemarc@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    3 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
      4
      ·
      3 months ago

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