diff --git a/go/vt/vtctl/backup.go b/go/vt/vtctl/backup.go index 46018834136..ea8d1aea061 100644 --- a/go/vt/vtctl/backup.go +++ b/go/vt/vtctl/backup.go @@ -27,11 +27,12 @@ import ( "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/mysqlctl" "vitess.io/vitess/go/vt/mysqlctl/backupstorage" - topodatapb "vitess.io/vitess/go/vt/proto/topodata" - vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/wrangler" + + topodatapb "vitess.io/vitess/go/vt/proto/topodata" + vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" ) func init() { diff --git a/go/vt/vtctl/cell_info.go b/go/vt/vtctl/cell_info.go index 0f9db98ce43..7eda91e9ad5 100644 --- a/go/vt/vtctl/cell_info.go +++ b/go/vt/vtctl/cell_info.go @@ -17,12 +17,11 @@ limitations under the License. package vtctl import ( + "context" "flag" "fmt" "strings" - "context" - "vitess.io/vitess/go/vt/wrangler" topodatapb "vitess.io/vitess/go/vt/proto/topodata" diff --git a/go/vt/vtctl/cells_aliases.go b/go/vt/vtctl/cells_aliases.go index b580e76fac9..f313cebce00 100644 --- a/go/vt/vtctl/cells_aliases.go +++ b/go/vt/vtctl/cells_aliases.go @@ -17,12 +17,11 @@ limitations under the License. package vtctl import ( + "context" "flag" "fmt" "strings" - "context" - "vitess.io/vitess/go/vt/wrangler" topodatapb "vitess.io/vitess/go/vt/proto/topodata" diff --git a/go/vt/vtctl/query.go b/go/vt/vtctl/query.go index 3acfe14ba39..530ce165649 100644 --- a/go/vt/vtctl/query.go +++ b/go/vt/vtctl/query.go @@ -17,6 +17,7 @@ limitations under the License. package vtctl import ( + "context" "encoding/json" "errors" "flag" @@ -24,11 +25,8 @@ import ( "io" "strconv" - "google.golang.org/protobuf/encoding/prototext" - - "context" - "github.com/olekukonko/tablewriter" + "google.golang.org/protobuf/encoding/prototext" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/callerid" diff --git a/go/vt/vtctl/reparent.go b/go/vt/vtctl/reparent.go index 5a5ac0fce5f..438a6945165 100644 --- a/go/vt/vtctl/reparent.go +++ b/go/vt/vtctl/reparent.go @@ -17,16 +17,15 @@ limitations under the License. package vtctl import ( + "context" "flag" "fmt" - "context" - + "vitess.io/vitess/go/vt/mysqlctl" "vitess.io/vitess/go/vt/topo" "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/wrangler" - "vitess.io/vitess/go/vt/mysqlctl" topodatapb "vitess.io/vitess/go/vt/proto/topodata" ) diff --git a/go/vt/vtctl/throttler.go b/go/vt/vtctl/throttler.go index cd1dabc68e0..2c3cfb3d943 100644 --- a/go/vt/vtctl/throttler.go +++ b/go/vt/vtctl/throttler.go @@ -17,17 +17,15 @@ limitations under the License. package vtctl import ( + "context" "flag" "fmt" "strconv" "strings" "time" - "google.golang.org/protobuf/encoding/prototext" - - "context" - "github.com/olekukonko/tablewriter" + "google.golang.org/protobuf/encoding/prototext" "vitess.io/vitess/go/vt/logutil" "vitess.io/vitess/go/vt/throttler" diff --git a/go/vt/vtctl/topo.go b/go/vt/vtctl/topo.go index da4550eb8c6..9cfda8e9564 100644 --- a/go/vt/vtctl/topo.go +++ b/go/vt/vtctl/topo.go @@ -17,6 +17,7 @@ limitations under the License. package vtctl import ( + "context" "encoding/json" "flag" "fmt" @@ -25,9 +26,6 @@ import ( "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/encoding/prototext" - - "context" - "google.golang.org/protobuf/proto" "vitess.io/vitess/go/vt/topo" diff --git a/go/vt/vtctl/vtctl.go b/go/vt/vtctl/vtctl.go index 1bf7a766284..ad07f5c5d12 100644 --- a/go/vt/vtctl/vtctl.go +++ b/go/vt/vtctl/vtctl.go @@ -82,6 +82,7 @@ COMMAND ARGUMENT DEFINITIONS */ import ( + "context" "encoding/json" "errors" "flag" @@ -95,9 +96,6 @@ import ( "time" "google.golang.org/protobuf/encoding/protojson" - - "context" - "google.golang.org/protobuf/proto" "vitess.io/vitess/go/cmd/vtctldclient/cli" @@ -145,6 +143,9 @@ type command struct { params string help string // if help is empty, won't list the command + // if set, PrintAllCommands will not show this command + hidden bool + // deprecation support deprecated bool deprecatedBy string @@ -360,12 +361,15 @@ var commands = []commandGroup{ name: "ShardReplicationAdd", method: commandShardReplicationAdd, params: " ", - help: "HIDDEN Adds an entry to the replication graph in the given cell."}, + help: "Adds an entry to the replication graph in the given cell.", + hidden: true, + }, { name: "ShardReplicationRemove", method: commandShardReplicationRemove, params: " ", - help: "HIDDEN Removes an entry from the replication graph in the given cell.", + help: "Removes an entry from the replication graph in the given cell.", + hidden: true, }, { name: "ShardReplicationFix", @@ -599,7 +603,8 @@ var commands = []commandGroup{ name: "Panic", method: commandPanic, params: "", - help: "HIDDEN Triggers a panic on the server side, to test the handling.", + help: "Triggers a panic on the server side, to test the handling.", + hidden: true, }, }, }, @@ -4118,7 +4123,7 @@ func PrintAllCommands(logger logutil.Logger) { for _, group := range commands { logger.Printf("%s:\n", group.name) for _, cmd := range group.commands { - if strings.HasPrefix(cmd.help, "HIDDEN") { + if cmd.hidden { continue } diff --git a/go/vt/vtctl/vtctl_test.go b/go/vt/vtctl/vtctl_test.go deleted file mode 100644 index 8179a2383da..00000000000 --- a/go/vt/vtctl/vtctl_test.go +++ /dev/null @@ -1 +0,0 @@ -package vtctl diff --git a/go/vt/vtctl/workflow.go b/go/vt/vtctl/workflow.go index 5265ca6ab1a..4d90511febf 100644 --- a/go/vt/vtctl/workflow.go +++ b/go/vt/vtctl/workflow.go @@ -17,11 +17,10 @@ limitations under the License. package vtctl import ( + "context" "flag" "fmt" - "context" - "vitess.io/vitess/go/vt/workflow" "vitess.io/vitess/go/vt/wrangler" )