From 209315c2af84b0cce997a5c907e603c5fab36125 Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Tue, 14 Jul 2015 20:15:02 -0700 Subject: [PATCH] Fixes #35: Retrieve dotted keys --- toml.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toml.go b/toml.go index 2896da7..bf35cd3 100644 --- a/toml.go +++ b/toml.go @@ -65,7 +65,11 @@ func (t *TomlTree) Get(key string) interface{} { if key == "" { return t } - return t.GetPath(strings.Split(key, ".")) + comps, err := parseKey(key) + if err != nil { + return nil + } + return t.GetPath(comps) } // GetPath returns the element in the tree indicated by 'keys'.