bugsmith@programming.dev to Golang@programming.dev · 8 months agoGo Enums Still Suckwww.zarl.devexternal-linkmessage-square13fedilinkarrow-up121arrow-down13
arrow-up118arrow-down1external-linkGo Enums Still Suckwww.zarl.devbugsmith@programming.dev to Golang@programming.dev · 8 months agomessage-square13fedilink
minus-squareSolemarc@lemmy.worldlinkfedilinkarrow-up1·8 months agoAs 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?
minus-squareEthan@programming.devlinkfedilinkEnglisharrow-up3·8 months agoYou are correct, Go doesn’t have enums. The const thing is a widely accepted pattern for approximating enums.
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?
You are correct, Go doesn’t have enums. The const thing is a widely accepted pattern for approximating enums.