MCPcopy Create free account
hub / github.com/abice/go-enum / String

Method String

example/color_enum.go:63–68  ·  view source on GitHub ↗

String implements the Stringer interface.

()

Source from the content-addressed store, hash-verified

61
62// String implements the Stringer interface.
63func (x Color) String() string {
64 if str, ok := _ColorMap[x]; ok {
65 return str
66 }
67 return fmt.Sprintf("Color(%d)", x)
68}
69
70// IsValid provides a quick way to determine if the typed value is
71// part of the allowed enumerated values

Callers 15

MarshalTextMethod · 0.95
AppendTextMethod · 0.95
TestStatusStringFunction · 0.45
TestNegativeStringFunction · 0.45
TestProductStringFunction · 0.45
TestForceUpperStringFunction · 0.45
TestExampleSQLStrOnlyFunction · 0.45
TestSQLStrExtrasFunction · 0.45
TestAnimalStringFunction · 0.45
TestEnum32BitFunction · 0.45
TestEnum64BitFunction · 0.45
TestForceLowerStringFunction · 0.45

Calls

no outgoing calls

Tested by 15

TestStatusStringFunction · 0.36
TestNegativeStringFunction · 0.36
TestProductStringFunction · 0.36
TestForceUpperStringFunction · 0.36
TestExampleSQLStrOnlyFunction · 0.36
TestSQLStrExtrasFunction · 0.36
TestAnimalStringFunction · 0.36
TestEnum32BitFunction · 0.36
TestEnum64BitFunction · 0.36
TestForceLowerStringFunction · 0.36
TestExampleSQLIntOnlyFunction · 0.36
TestSQLIntExtrasFunction · 0.36