mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Use new gofumpt (#21613)
Update tinylib. Should fix CI. `gofumpt -w .&&go generate ./...`
This commit is contained in:
@@ -453,7 +453,7 @@ func ParseConfigTargetID(r io.Reader) (ids map[string]bool, err error) {
|
||||
if err := scanner.Err(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return
|
||||
return ids, err
|
||||
}
|
||||
|
||||
// ReadConfig - read content from input and write into c.
|
||||
@@ -578,7 +578,7 @@ var validSiteNameRegex = regexp.MustCompile("^[a-z][a-z0-9-]+$")
|
||||
// region sub-system as well.
|
||||
func LookupSite(siteKV KVS, regionKV KVS) (s Site, err error) {
|
||||
if err = CheckValidKeys(SiteSubSys, siteKV, DefaultSiteKVS); err != nil {
|
||||
return
|
||||
return s, err
|
||||
}
|
||||
region := env.Get(EnvRegion, "")
|
||||
if region == "" {
|
||||
@@ -596,7 +596,7 @@ func LookupSite(siteKV KVS, regionKV KVS) (s Site, err error) {
|
||||
// is legacy, we return an error to tell the user to
|
||||
// reset the region via the new command.
|
||||
err = Errorf("could not load region from legacy configuration as it was invalid - use 'mc admin config set myminio site region=myregion name=myname' to set a region and name (%v)", err)
|
||||
return
|
||||
return s, err
|
||||
}
|
||||
|
||||
region = regionKV.Get(RegionName)
|
||||
@@ -606,7 +606,7 @@ func LookupSite(siteKV KVS, regionKV KVS) (s Site, err error) {
|
||||
err = Errorf(
|
||||
"region '%s' is invalid, expected simple characters such as [us-east-1, myregion...]",
|
||||
region)
|
||||
return
|
||||
return s, err
|
||||
}
|
||||
s.region = region
|
||||
}
|
||||
@@ -617,11 +617,11 @@ func LookupSite(siteKV KVS, regionKV KVS) (s Site, err error) {
|
||||
err = Errorf(
|
||||
"site name '%s' is invalid, expected simple characters such as [cal-rack0, myname...]",
|
||||
name)
|
||||
return
|
||||
return s, err
|
||||
}
|
||||
s.name = name
|
||||
}
|
||||
return
|
||||
return s, err
|
||||
}
|
||||
|
||||
// CheckValidKeys - checks if inputs KVS has the necessary keys,
|
||||
@@ -1196,13 +1196,13 @@ func (c Config) ResolveConfigParam(subSys, target, cfgParam string, redactSecret
|
||||
|
||||
// Initially only support OpenID
|
||||
if !resolvableSubsystems.Contains(subSys) {
|
||||
return
|
||||
return value, cs, isRedacted
|
||||
}
|
||||
|
||||
// Check if config param requested is valid.
|
||||
defKVS, ok := DefaultKVS[subSys]
|
||||
if !ok {
|
||||
return
|
||||
return value, cs, isRedacted
|
||||
}
|
||||
|
||||
defValue, isFound := defKVS.Lookup(cfgParam)
|
||||
@@ -1211,7 +1211,7 @@ func (c Config) ResolveConfigParam(subSys, target, cfgParam string, redactSecret
|
||||
defValue, isFound = "", true
|
||||
}
|
||||
if !isFound {
|
||||
return
|
||||
return value, cs, isRedacted
|
||||
}
|
||||
|
||||
if target == "" {
|
||||
@@ -1236,7 +1236,7 @@ func (c Config) ResolveConfigParam(subSys, target, cfgParam string, redactSecret
|
||||
value = env.Get(envVar, "")
|
||||
if value != "" {
|
||||
cs = ValueSourceEnv
|
||||
return
|
||||
return value, cs, isRedacted
|
||||
}
|
||||
|
||||
// Lookup config store.
|
||||
@@ -1246,7 +1246,7 @@ func (c Config) ResolveConfigParam(subSys, target, cfgParam string, redactSecret
|
||||
value, ok3 = kvs.Lookup(cfgParam)
|
||||
if ok3 {
|
||||
cs = ValueSourceCfg
|
||||
return
|
||||
return value, cs, isRedacted
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1254,7 +1254,7 @@ func (c Config) ResolveConfigParam(subSys, target, cfgParam string, redactSecret
|
||||
// Return the default value.
|
||||
value = defValue
|
||||
cs = ValueSourceDef
|
||||
return
|
||||
return value, cs, isRedacted
|
||||
}
|
||||
|
||||
// KVSrc represents a configuration parameter key and value along with the
|
||||
|
||||
Reference in New Issue
Block a user