Create a gist now

Instantly share code, notes, and snippets.

@maplebed /main.out
Last active Mar 25, 2017

What would you like to do?
Output from logfmt lib
➜ go run main.go
0: `foo=bar` // correct
(map[string]interface {}) (len=1) {
(string) (len=3) "foo": (string) (len=3) "bar"
}
1: `foo=bar baz=3 fl=3.1415926535 bl=true` // correct
(map[string]interface {}) (len=4) {
(string) (len=2) "bl": (bool) true,
(string) (len=3) "foo": (string) (len=3) "bar",
(string) (len=3) "baz": (int) 3,
(string) (len=2) "fl": (float64) 3.1415926535
}
2: `foo=bar ben=one two baz=3` // failed - `two` became its own key
(map[string]interface {}) (len=4) {
(string) (len=3) "baz": (int) 3,
(string) (len=3) "foo": (string) (len=3) "bar",
(string) (len=3) "ben": (string) (len=3) "one",
(string) (len=3) "two": (string) ""
}
3: `foo=bar eq="a test with = signs" baz=3` // correct
(map[string]interface {}) (len=3) {
(string) (len=3) "foo": (string) (len=3) "bar",
(string) (len=2) "eq": (string) (len=19) "a test with = signs",
(string) (len=3) "baz": (int) 3
}
4: `foo=bar unq=astr=with=equals?and*stuff baz=3` // failed - `with` became its own key
(map[string]interface {}) (len=4) {
(string) (len=3) "foo": (string) (len=3) "bar",
(string) (len=3) "unq": (string) (len=4) "astr",
(string) (len=4) "with": (string) (len=16) "equals?and*stuff",
(string) (len=3) "baz": (int) 3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment