mirror of
https://github.com/minio/mc.git
synced 2025-11-12 01:02:26 +03:00
Revert "unstruct client functions"
This commit is contained in:
@@ -59,16 +59,16 @@ func runCatCmd(ctx *cli.Context) {
|
||||
log.Debug.Println(iodine.New(err, nil))
|
||||
console.Fatalf("reading host config for URL [%s] failed with following reason: [%s]\n", sourceURLs, iodine.ToError(err))
|
||||
}
|
||||
humanReadable, err := doCatCmd(sourceURLConfigMap, standardOutput, globalDebugFlag)
|
||||
humanReadable, err := doCatCmd(mcClientMethods{}, sourceURLConfigMap, standardOutput, globalDebugFlag)
|
||||
if err != nil {
|
||||
log.Debug.Println(iodine.New(err, nil))
|
||||
console.Fatalln(humanReadable)
|
||||
}
|
||||
}
|
||||
|
||||
func doCatCmd(sourceURLConfigMap map[string]*hostConfig, targetURL string, debug bool) (string, error) {
|
||||
func doCatCmd(methods clientMethods, sourceURLConfigMap map[string]*hostConfig, targetURL string, debug bool) (string, error) {
|
||||
for url, config := range sourceURLConfigMap {
|
||||
sourceClnt, err := getNewClient(url, config, debug)
|
||||
sourceClnt, err := methods.getNewClient(url, config, debug)
|
||||
if err != nil {
|
||||
return "Unable to create client: " + url, iodine.New(err, nil)
|
||||
}
|
||||
@@ -78,7 +78,7 @@ func doCatCmd(sourceURLConfigMap map[string]*hostConfig, targetURL string, debug
|
||||
}
|
||||
defer reader.Close()
|
||||
|
||||
stdOutClnt, err := getNewClient(targetURL, &hostConfig{}, debug)
|
||||
stdOutClnt, err := methods.getNewClient(targetURL, &hostConfig{}, debug)
|
||||
if err != nil {
|
||||
return "Unable to create client: " + url, iodine.New(err, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user