fs: Make Option.GetValue() public #2541

This commit is contained in:
Nick Craig-Wood 2018-10-01 15:52:39 +01:00
parent e7e467fb3a
commit 1557287c64
1 changed files with 5 additions and 5 deletions

View File

@ -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