diff options
author | Chris <ccbrown112@gmail.com> | 2017-10-30 11:58:00 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-30 11:58:00 -0500 |
commit | 3cbacb6858ea2dda67719de64854ed30dea3b626 (patch) | |
tree | 8d0177242e65c809250fa73bd93faae26bd1ca10 /cmd | |
parent | c5e8cb25caa39ed018ede5270e1566e8f7448396 (diff) | |
download | chat-3cbacb6858ea2dda67719de64854ed30dea3b626.tar.gz chat-3cbacb6858ea2dda67719de64854ed30dea3b626.tar.bz2 chat-3cbacb6858ea2dda67719de64854ed30dea3b626.zip |
Remove unused variables / code (#7736)
* remove unused variables / code
* fix bug in testPostStoreGetOldest
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/platform/cmdtestlib.go | 45 | ||||
-rw-r--r-- | cmd/platform/output.go | 12 |
2 files changed, 0 insertions, 57 deletions
diff --git a/cmd/platform/cmdtestlib.go b/cmd/platform/cmdtestlib.go deleted file mode 100644 index 16bfc2b21..000000000 --- a/cmd/platform/cmdtestlib.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -package main - -import ( - "bytes" - "strings" - - "github.com/spf13/cobra" - "github.com/spf13/pflag" -) - -func runCommand(argString string) error { - err, _ := runCommandWithOutput(argString) - - return err -} - -func runCommandWithOutput(argString string) (error, string) { - // Set arguments on the root command - rootCmd.SetArgs(strings.Split(argString, " ")) - defer rootCmd.SetArgs([]string{}) - - output := new(bytes.Buffer) - rootCmd.SetOutput(output) - defer rootCmd.SetOutput(nil) - - // Executing the root command will call the necessary subcommand - cmd, err := rootCmd.ExecuteC() - - // And clear the arguments on the subcommand that was actually called since they'd otherwise - // be used on the next call to this command - clearArgs(cmd) - - return err, output.String() -} - -func clearArgs(command *cobra.Command) { - command.Flags().VisitAll(clearFlag) -} - -func clearFlag(flag *pflag.Flag) { - flag.Value.Set(flag.DefValue) -} diff --git a/cmd/platform/output.go b/cmd/platform/output.go index e4666910e..edf6ccc71 100644 --- a/cmd/platform/output.go +++ b/cmd/platform/output.go @@ -11,22 +11,10 @@ func CommandPrintln(a ...interface{}) (int, error) { return fmt.Println(a...) } -func CommandPrint(a ...interface{}) (int, error) { - return fmt.Print(a...) -} - func CommandPrintErrorln(a ...interface{}) (int, error) { return fmt.Fprintln(os.Stderr, a...) } -func CommandPrintError(a ...interface{}) (int, error) { - return fmt.Fprint(os.Stderr, a...) -} - func CommandPrettyPrintln(a ...interface{}) (int, error) { return fmt.Fprintln(os.Stderr, a...) } - -func CommandPrettyPrint(a ...interface{}) (int, error) { - return fmt.Fprint(os.Stderr, a...) -} |