1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-01-07 12:38:05 +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. // It should never be used as a value, as it won't get serialized as such.
const Null = -1 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 // Enum values should only consist of positive values, as negative values are reserved for internal constants, such as
// Null. // Null.
// This also mean that only 7 of the 8 Bit will be available for storage. // This also means that only 31 of the 32 bits will be available for storage.
type Enum int8 type Enum int32
// Int8ToJSON converts the passed Enum to a byte slice with it's JSON representation. // Int8ToJSON converts the passed Enum to a byte slice with it's JSON representation.
func ToJSON(i Enum) []byte { func ToJSON(i Enum) []byte {