From db1b508d8b418ef67617a9770b0d0020de427f88 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 23 Sep 2020 13:00:06 -0700 Subject: [PATCH] update minio to pkg/madmin changes --- cmd/main.go | 11 ++++------- go.mod | 2 +- go.sum | 8 ++++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index d5b03ce4..e87171d4 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -281,19 +281,16 @@ func registerBefore(ctx *cli.Context) error { // findClosestCommands to match a given string with commands trie tree. func findClosestCommands(command string) []string { - var closestCommands []string - for _, value := range commandsTree.PrefixMatch(command) { - closestCommands = append(closestCommands, value.(string)) - } + closestCommands := commandsTree.PrefixMatch(command) sort.Strings(closestCommands) // Suggest other close commands - allow missed, wrongly added and even transposed characters for _, value := range commandsTree.Walk(commandsTree.Root()) { - if sort.SearchStrings(closestCommands, value.(string)) < len(closestCommands) { + if sort.SearchStrings(closestCommands, value) < len(closestCommands) { continue } // 2 is arbitrary and represents the max allowed number of typed errors - if words.DamerauLevenshteinDistance(command, value.(string)) < 2 { - closestCommands = append(closestCommands, value.(string)) + if words.DamerauLevenshteinDistance(command, value) < 2 { + closestCommands = append(closestCommands, value) } } return closestCommands diff --git a/go.mod b/go.mod index 92d3e663..57886a7b 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/mattn/go-isatty v0.0.12 github.com/mattn/go-runewidth v0.0.9 // indirect github.com/minio/cli v1.22.0 - github.com/minio/minio v0.0.0-20200917180950-00555c747ec5 + github.com/minio/minio v0.0.0-20200923193814-ac82f416a49c github.com/minio/minio-go/v7 v7.0.6-0.20200918223035-9cefc0929b69 github.com/minio/sha256-simd v0.1.1 github.com/mitchellh/go-homedir v1.1.0 diff --git a/go.sum b/go.sum index a8ea1bbb..0f704da3 100644 --- a/go.sum +++ b/go.sum @@ -4,7 +4,9 @@ cloud.google.com/go v0.39.0 h1:UgQP9na6OTfp4dsAiz/eFpFA1C6tPdH5wiRdi19tuMw= cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts= git.apache.org/thrift.git v0.13.0 h1:/3bz5WZ+sqYArk7MBBBbDufMxKKOA56/6JO6psDpUDY= git.apache.org/thrift.git v0.13.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= +github.com/Azure/azure-pipeline-go v0.2.2 h1:6oiIS9yaG6XCCzhgAgKFfIWyo4LLCiDhZot6ltoThhY= github.com/Azure/azure-pipeline-go v0.2.2/go.mod h1:4rQ/NZncSvGqNkkOsNpOU1tgoNuIlp9AfUH5G1tvCHc= +github.com/Azure/azure-storage-blob-go v0.10.0 h1:evCwGreYo3XLeBV4vSxLbLiYb6e0SzsJiXQVRGsRXxs= github.com/Azure/azure-storage-blob-go v0.10.0/go.mod h1:ep1edmW+kNQx4UfWM9heESNmQdijykocJ0YOxmMX8SE= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= @@ -291,11 +293,9 @@ github.com/minio/highwayhash v1.0.0 h1:iMSDhgUILCr0TNm8LWlSjF8N0ZIj2qbO8WHp6Q/J2 github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= github.com/minio/md5-simd v1.1.0 h1:QPfiOqlZH+Cj9teu0t9b1nTBfPbyTl16Of5MeuShdK4= github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw= -github.com/minio/minio v0.0.0-20200917180950-00555c747ec5 h1:GbSBKx3pg3GoPx/QwSZzVFGlp44f32zAt87fm3eMgTU= -github.com/minio/minio v0.0.0-20200917180950-00555c747ec5/go.mod h1:dRmX9jR9niWrTvRjwHQfNdUFSsvsJM6wQbRdBMIg2YQ= +github.com/minio/minio v0.0.0-20200923193814-ac82f416a49c h1:EiJNxSzsV3qiFS7h+eSjLGS6leNu4W9xoX3J3nMvtCA= +github.com/minio/minio v0.0.0-20200923193814-ac82f416a49c/go.mod h1:dRmX9jR9niWrTvRjwHQfNdUFSsvsJM6wQbRdBMIg2YQ= github.com/minio/minio-go/v7 v7.0.5-0.20200811211821-14ed05478889/go.mod h1:CSt2ETZNs+bIIhWTse0mcZKZWMGrFU7Er7RR0TmkDYk= -github.com/minio/minio-go/v7 v7.0.6-0.20200901014009-5f8d15bbc5fd h1:38hrGmWnv+C+yBcKgAWipiwRDu7Exr0kKAfy1QArW0g= -github.com/minio/minio-go/v7 v7.0.6-0.20200901014009-5f8d15bbc5fd/go.mod h1:CSt2ETZNs+bIIhWTse0mcZKZWMGrFU7Er7RR0TmkDYk= github.com/minio/minio-go/v7 v7.0.6-0.20200918223035-9cefc0929b69 h1:/FOBaOo5vVZrw0QRq1mYrIoQ1tiIi6PLCtYmdb68B0Q= github.com/minio/minio-go/v7 v7.0.6-0.20200918223035-9cefc0929b69/go.mod h1:CSt2ETZNs+bIIhWTse0mcZKZWMGrFU7Er7RR0TmkDYk= github.com/minio/selfupdate v0.3.1 h1:BWEFSNnrZVMUWXbXIgLDNDjbejkmpAmZvy/nCz1HlEs=