github.com/xdg-go/strum (go): Package strum provides a string unmarshaler to tokenize line-oriented text (such as from stdin) and convert tokens into simple Go types.  Tokenization defaults to whitespace-separated fields, but strum supports using delimiters, regular expressions, or a custom tokenizer.  A line with a single token can be unmarshaled into a single variable of any supported type.  A line with multiple tokens can be unmarshaled into a slice or a struct of supported types.  It can also be unmarshaled into a single string, in which case tokenization is skipped.  Trying to unmarshal multiple tokens into a single variable or too many tokens for the number of fields in a struct will result in an error.  Having too few tokens for the fields in a struct is allowed; remaining fields will be zeroed.  When unmarshaling to a slice, decoded values are appended; existing values are untouched.  strum supports the following types:  Additionally, there is special support for certain types:  For numeric types, all Go literal formats are supported, including base prefixes (`0xff`) and underscores (`1_000_000`) for integers.  For time.Time, strum detects and parses  a wide varity of formats using the github.com/araddon/dateparse library. By default, it favors United States interpretation of MM/DD/YYYY and has time zone semantics equivalent to `time.Parse`.  strum allows specifying a custom parser instead.  strum provides `DecodeAll` to unmarshal all lines of input at once.
Keywords: go