Documentation ¶
Overview ¶
"Missing feature" of the Go packages `encoding` and `fmt`: unmarshal arbitrary text into an arbitrary value. Counterpart to the marshaling functionality of `fmt.Sprint`.
Examples ¶
Decode individual values:
var num int64 err := untext.Parse(`10`, &num) var inst time.Time err = untext.Parse(`0001-02-03T04:05:06Z`, &inst)
Decode slices:
var nums []int64 err = untext.ParseSlice([]string{`10`, `20`}, &nums)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseSlice ¶ added in v0.1.3
Parses a slice of strings. The destination must be a non-nil pointer to a slice. Allocates a slice of the appropriate type and calls `Parse` for each element, passing the corresponding string from the input slice.
Types ¶
Click to show internal directories.
Click to hide internal directories.