Documentation ¶
Overview ¶
Package sliceparts contains routines to parse components of string slices into string, int32, and int64 variables.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Consume ¶
Consume parses len(output) elements of input into their respective output variables. Each output must be a pointer to a supported type. What is stored to the output depends on its type:
*string: input[i] is directly copied *int32: strconv.ParseInt(input[i], 10, 32) is called *int64: strconv.ParseInt(input[i], 10, 64) is called
If an output element is a nil interface{}, the associated input element is skipped. A nil pointer value is also accepted - in that case the input element is validated but no attempt to store it is made.
If len(output) > len(input), an error is returned.
If any output has an unsupported type, an error is returned.
If strconv.ParseInt returns an error for any integer output, its error is returned.
Otherwise, this function returns (input[len(output):], nil).
Types ¶
This section is empty.