From 308b88a8d8c326ee4a25525e42147f83b5317849 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 24 Jul 2014 11:40:46 -0700 Subject: [PATCH] flatmap: never auto-convert ints --- flatmap/expand.go | 4 +--- flatmap/expand_test.go | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/flatmap/expand.go b/flatmap/expand.go index 87bc9b5da..2b689281e 100644 --- a/flatmap/expand.go +++ b/flatmap/expand.go @@ -11,9 +11,7 @@ import ( func Expand(m map[string]string, key string) interface{} { // If the key is exactly a key in the map, just return it if v, ok := m[key]; ok { - if num, err := strconv.ParseInt(v, 0, 0); err == nil { - return int(num) - } else if v == "true" { + if v == "true" { return true } else if v == "false" { return false diff --git a/flatmap/expand_test.go b/flatmap/expand_test.go index baf68e6a9..061e26897 100644 --- a/flatmap/expand_test.go +++ b/flatmap/expand_test.go @@ -44,7 +44,7 @@ func TestExpand(t *testing.T) { Output: []interface{}{ map[string]interface{}{ "name": "bar", - "port": 3000, + "port": "3000", "enabled": true, }, }, @@ -63,8 +63,8 @@ func TestExpand(t *testing.T) { map[string]interface{}{ "name": "bar", "ports": []interface{}{ - 1, - 2, + "1", + "2", }, }, },