Documentation
¶
Overview ¶
Package datadrivenutil defines facilities to improve ergonomics around parsing datadriven test input.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fields ¶
type Fields []string
Fields wraps a []string with facilities for parsing out values.
func (Fields) HexBytes ¶
HexBytes parses all the fields as hex-encoded bytes, returning the concatenated decoded bytes. It panics if any of the fields fail to parse as hex-encoded bytes.
func (Fields) Index ¶
Index returns the field at index i, or the empty string if there are i or fewer fields.
func (Fields) KeyValue ¶
KeyValue looks for a field containing a key=value pair with the provided key. If not found, KeyValue returns false for the second return value.
func (Fields) MustKeyValue ¶
MustKeyValue is like KeyValue but panics if the field is not found.
type Lines ¶
type Lines string
Lines wraps a string, providing facilities for parsing individual lines.
type Value ¶
type Value string
A Value represents a single string of unknown structure. A Value is sometimes used to represent an entire element of a Fields and other times a substring of an individual field. This blurring of semantics is convenient for parsing.
func (Value) HexBytes ¶
HexBytes decodes the value as hex-encoded bytes. It panics if the value fails to decode as hex-encoded.