From 1557287c64f4d026b4fffd16402d43cb32bc9564 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 1 Oct 2018 15:52:39 +0100 Subject: [PATCH] fs: Make Option.GetValue() public #2541 --- fs/fs.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/fs.go b/fs/fs.go index 390d9364a..ec6d1e267 100644 --- a/fs/fs.go +++ b/fs/fs.go @@ -125,8 +125,8 @@ type Option struct { Advanced bool // set if this is an advanced config option } -// Gets the current current value which is the default if not set -func (o *Option) value() interface{} { +// GetValue gets the current current value which is the default if not set +func (o *Option) GetValue() interface{} { val := o.Value if val == nil { val = o.Default @@ -136,12 +136,12 @@ func (o *Option) value() interface{} { // String turns Option into a string func (o *Option) String() string { - return fmt.Sprint(o.value()) + return fmt.Sprint(o.GetValue()) } // Set a Option from a string func (o *Option) Set(s string) (err error) { - newValue, err := configstruct.StringToInterface(o.value(), s) + newValue, err := configstruct.StringToInterface(o.GetValue(), s) if err != nil { return err } @@ -151,7 +151,7 @@ func (o *Option) Set(s string) (err error) { // Type of the value func (o *Option) Type() string { - return reflect.TypeOf(o.value()).Name() + return reflect.TypeOf(o.GetValue()).Name() } // FlagName for the option