Using Java Strings As Enums In Go

Drasko DRASKOVIC <drasko@...>

Hi all,
we have opened a discussion here: around the fact that
strings are used as enumed flags in Java, while Go does not really
have enums of this type. More info can be found here:

for example you can see one of this enums in Java, or here also:
And here is the proposed equivalent representation in Go:

My question is: do we really need this string values for the enum vars
like we use in Java, or maybe Java can switch to int types for these
flags and then be aligned with Go? I.e. why for a type of compression
we have to use string "NONE" or "GZIP" or similar, when instead we can
use just type codes - for example NONE = 0, GZIP = 1 - and then we
will know how to distinguish them (I have explained this in my
comments on PR here:

What do you think that it is the best way to handle this case?

Best regards,
Mainflux Author and Technical Advisor | Industrial IoT Cloud
Engineering Division | Paris, France

Twitter: @draskodraskovic