From e9bc0905d1789a26847eacb9316721f7dbbf71bf Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Mon, 16 Nov 2015 19:55:08 -0800 Subject: [PATCH] Add missing param and error in the missing case so default will work as expected --- client/config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/config/config.go b/client/config/config.go index 92c05e6c3..1044ff773 100644 --- a/client/config/config.go +++ b/client/config/config.go @@ -80,7 +80,7 @@ func (c *Config) ReadDefault(id string, defaultValue string) string { func (c *Config) ReadBool(id string) (bool, error) { val, ok := c.Options[id] if !ok { - return false, nil + return false, fmt.Errorf("Specified config is missing from options") } bval, err := strconv.ParseBool(val) if err != nil { @@ -92,7 +92,7 @@ func (c *Config) ReadBool(id string) (bool, error) { // ReadBoolDefault tries to parse the specified option as a boolean. If there is // an error in parsing, the default option is returned. func (c *Config) ReadBoolDefault(id string, defaultValue bool) bool { - val, err := c.ReadBool() + val, err := c.ReadBool(id) if err != nil { return defaultValue }