Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AllCases = []Case{ Stet, Upper, Lower, }
AllCases lists all 3 values in order.
Functions ¶
This section is empty.
Types ¶
type Case ¶
type Case int
func AsCase ¶
AsCase parses a string to find the corresponding Case, accepting either one of the string values or a number. The input representation is determined by caseMarshalTextRep. It wraps Parse.
func CaseOf ¶
CaseOf returns a Case based on an ordinal number. This is the inverse of Ordinal. If the ordinal is out of range, an invalid Case is returned.
func MustParseCase ¶ added in v3.0.2
MustParseCase is similar to AsCase except that it panics on error.
func (Case) Expression ¶
func (Case) Ordinal ¶
Ordinal returns the ordinal number of a Case. This is an integer counting from zero. It is *not* the same as the const number assigned to the value.
func (*Case) Parse ¶
Parse parses a string to find the corresponding Case, accepting one of the string values or a number. The input representation is determined by None. It is used by AsCase.
Usage Example
v := new(Case) err := v.Parse(s) ... etc