From d81a1640c945d4ec2a349317102967c0872fe972 Mon Sep 17 00:00:00 2001 From: brettlangdon Date: Sun, 28 Jun 2015 08:15:23 -0400 Subject: [PATCH] add Keys method to Section --- section.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/section.go b/section.go index 7d20b59..593cfef 100644 --- a/section.go +++ b/section.go @@ -190,6 +190,16 @@ func (section *Section) HasParent() bool { return section.parent != nil } +// Keys will return back a list of all setting names in this Section +func (section *Section) Keys() []string { + keys := make([]string, 0) + for key, _ := range section.values { + keys = append(keys, key) + } + + return keys +} + // Set will set a value (Primative or Section) to the provided name func (section *Section) Set(name string, value Value) { section.values[name] = value