Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind int
Kind demonstrates integer style enums
func (Kind) Bytes ¶
Bytes returns a byte-level representation of String(). If !k.Defined(), then a generated string is returned based on k's value.
func (Kind) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (Kind) Next ¶
Next returns the next defined Kind. If k is not defined, then Next returns the first defined value. Next() can be used to loop through all values of an enum.
k := Kind(0)
for {
fmt.Println(k)
k = k.Next()
if k == Kind(0) {
break
}
}
The exact order that values are returned when looping should not be relied upon.
func (*Kind) Scan ¶
Scan implements fmt.Scanner. Use fmt.Scan to parse strings into Kind values
func (Kind) String ¶
String implements fmt.Stringer. If !k.Defined(), then a generated string is returned based on k's value.
func (*Kind) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler
type StrKind ¶
type StrKind string
StrKind demonstrates string style enums
func (StrKind) Bytes ¶
Bytes returns a byte-level representation of String(). If !s.Defined(), then a generated string is returned based on s's value.
func (StrKind) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (StrKind) Next ¶
Next returns the next defined StrKind. If s is not defined, then Next returns the first defined value. Next() can be used to loop through all values of an enum.
s := StrKind("")
for {
fmt.Println(s)
s = s.Next()
if s == StrKind("") {
break
}
}
The exact order that values are returned when looping should not be relied upon.
func (*StrKind) Scan ¶
Scan implements fmt.Scanner. Use fmt.Scan to parse strings into StrKind values
func (StrKind) String ¶
String implements fmt.Stringer. If !s.Defined(), then a generated string is returned based on s's value.
func (*StrKind) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler