Documentation ¶
Overview ¶
Package strpair implements parsing and formatting of lists of colon-delimited key-value pair strings.
Example of pairs:
master:tryserver.chromium.linux builder:linux_chromium_rel_ng buildset:patch/gerrit/chromium-review.googlesource.com/677784/5
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse parses a colon-delimited key-value pair.
If pair does not have ":", the whole string becomes the key with an empty value.
Example (Hierarchical) ¶
pairs := []string{ "foo:bar", "swarming_tag:a:1", "swarming_tag:b:2", } tags := ParseMap(ParseMap(pairs)["swarming_tag"]) fmt.Println(tags.Get("a")) fmt.Println(tags.Get("b"))
Output: 1 2
Types ¶
type Map ¶
Map contains parsed string pairs.
Click to show internal directories.
Click to hide internal directories.