1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-01-05 19:57:02 +00:00

utils: Change Enum to int32

This commit is contained in:
unknown 2021-05-22 00:36:43 +01:00 committed by diamondburned
parent d69abe49de
commit 3b212908a5

View file

@ -6,11 +6,11 @@ import "strconv"
// It should never be used as a value, as it won't get serialized as such.
const Null = -1
// Enum is a nullable version of a uint8.
// Enum is a nullable version of a uint32.
// Enum values should only consist of positive values, as negative values are reserved for internal constants, such as
// Null.
// This also mean that only 7 of the 8 Bit will be available for storage.
type Enum int8
// This also means that only 31 of the 32 bits will be available for storage.
type Enum int32
// Int8ToJSON converts the passed Enum to a byte slice with it's JSON representation.
func ToJSON(i Enum) []byte {