diff --git a/cmd/signald-cli/cmd/listGroups.go b/cmd/signald-cli/cmd/listGroups.go index cdfbf8d..e455b84 100644 --- a/cmd/signald-cli/cmd/listGroups.go +++ b/cmd/signald-cli/cmd/listGroups.go @@ -32,15 +32,15 @@ var listGroupsCmd = &cobra.Command{ Run: func(cmd *cobra.Command, args []string) { requestID := fmt.Sprint("signald-cli-", rand.Intn(1000)) s.SendRequest(signald.Request{ - Type: "list_groups", - Username: username, - ID: requestID, + Type: "list_groups", + Username: username, + ID: requestID, }) c := make(chan signald.Response) go s.Listen(c) for { - message := <- c + message := <-c if message.ID == requestID { for _, group := range message.Data.Groups { fmt.Println(group.Name) diff --git a/cmd/signald-cli/cmd/root.go b/cmd/signald-cli/cmd/root.go index be86034..de24eb8 100644 --- a/cmd/signald-cli/cmd/root.go +++ b/cmd/signald-cli/cmd/root.go @@ -33,7 +33,7 @@ var s *signald.Signald var RootCmd = &cobra.Command{ Use: "signald-cli", Short: "Interact with a running siangld instance", - Long: `signald-cli is a command line tool to interact with signald.`, + Long: `signald-cli is a command line tool to interact with signald.`, } // Execute adds all child commands to the root command sets flags appropriately. @@ -49,7 +49,7 @@ func init() { cobra.OnInitialize(initConfig) RootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.signald-cli.yaml)") RootCmd.PersistentFlags().StringVarP(&socketPath, "socket", "s", "/var/run/signald/signald.sock", "the path to the signald socket file") - s = &signald.Signald{SocketPath: socketPath,} + s = &signald.Signald{SocketPath: socketPath} s.Connect() } @@ -60,8 +60,8 @@ func initConfig() { } viper.SetConfigName(".signald-cli") // name of config file (without extension) - viper.AddConfigPath("$HOME") // adding home directory as first search path - viper.AutomaticEnv() // read in environment variables that match + viper.AddConfigPath("$HOME") // adding home directory as first search path + viper.AutomaticEnv() // read in environment variables that match // If a config file is found, read it in. if err := viper.ReadInConfig(); err == nil {