Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

fs: Make Option.GetValue() public #2541

Nick Craig-Wood1557287c64f4
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