aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/go-ini/ini/section.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/go-ini/ini/section.go')
-rw-r--r--vendor/github.com/go-ini/ini/section.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/github.com/go-ini/ini/section.go b/vendor/github.com/go-ini/ini/section.go
index 45d2f3b..806f149 100644
--- a/vendor/github.com/go-ini/ini/section.go
+++ b/vendor/github.com/go-ini/ini/section.go
@@ -82,6 +82,17 @@ func (s *Section) NewKey(name, val string) (*Key, error) {
return s.keys[name], nil
}
+// NewBooleanKey creates a new boolean type key to given section.
+func (s *Section) NewBooleanKey(name string) (*Key, error) {
+ key, err := s.NewKey(name, "true")
+ if err != nil {
+ return nil, err
+ }
+
+ key.isBooleanType = true
+ return key, nil
+}
+
// GetKey returns key in section by given name.
func (s *Section) GetKey(name string) (*Key, error) {
// FIXME: change to section level lock?