Issue #1: Fixed that Keys() returns an empty key.
diff --git a/README.md b/README.md index d1afbe6..1270e64 100644 --- a/README.md +++ b/README.md
@@ -44,6 +44,10 @@ History ------- +v1.4.1, 13 Nov 2014 +------------------- + * (Issue #1) Fixed bug in Keys() method which returned an empty string + v1.4.0, 23 Sep 2014 ------------------- * Added Keys() to get the keys
diff --git a/properties.go b/properties.go index e9386fb..cde68fe 100644 --- a/properties.go +++ b/properties.go
@@ -362,7 +362,7 @@ // Keys returns all keys. func (p *Properties) Keys() []string { - keys := make([]string, len(p.m)) + keys := make([]string, 0, len(p.m)) for k, _ := range p.m { keys = append(keys, k) }
diff --git a/properties_test.go b/properties_test.go index ba5d6be..4abe20b 100644 --- a/properties_test.go +++ b/properties_test.go
@@ -560,6 +560,7 @@ p, err := parse(test.input) c.Assert(err, IsNil) c.Assert(p.Len(), Equals, len(test.keys)) + c.Assert(len(p.Keys()), Equals, len(test.keys)) for _, key := range test.keys { _, ok := p.Get(key) c.Assert(ok, Equals, true)