Skip to content

Why are there no enums in Go? #17205

Closed
Closed
@RaeesBhatti

Description

@RaeesBhatti

What version of Go are you using and what is your operating system and processor architecture?

go version go1.7.1 darwin/amd64

What did you do?

Tried to declare enums in my package.

What did you expect to see?

That there would be some mechanism to declare enums types.

What did you see instead?

That there was no native way to declare enum types in Go lang instead I saw some weird hacks to make things work barely.

What is your question?

Why is there no native way to declare enum types in Go lang, it is such a useful and convenient feature.
Here are enums in HackLang for example.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions