this post was submitted on 20 Mar 2024
19 points (88.0% liked)

Golang

2482 readers
10 users here now

This is a community dedicated to the go programming language.

Useful Links:

Rules:

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] Solemarc@lemmy.world 2 points 1 year ago (1 children)

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?

[–] firelizzard@programming.dev 4 points 1 year ago

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