diff options
author | Jon Bratseth <bratseth@gmail.com> | 2021-08-25 09:48:07 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2021-08-25 09:48:07 +0200 |
commit | f335be06085e8f8105246fd84a5e568c4e193c15 (patch) | |
tree | c4e2075f8f0126b2a1e089066443ec9f1b440d40 /client/go/cmd/status.go | |
parent | c43e37dcfb49d50a2b4109e4f8ac9a1d3ae0609e (diff) |
go fmt
Diffstat (limited to 'client/go/cmd/status.go')
-rw-r--r-- | client/go/cmd/status.go | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/client/go/cmd/status.go b/client/go/cmd/status.go index 4187c34c2b1..4425bc44d5b 100644 --- a/client/go/cmd/status.go +++ b/client/go/cmd/status.go @@ -5,57 +5,57 @@ package cmd import ( - "github.com/spf13/cobra" - "github.com/vespa-engine/vespa/util" + "github.com/spf13/cobra" + "github.com/vespa-engine/vespa/util" ) func init() { - rootCmd.AddCommand(statusCmd) - statusCmd.AddCommand(statusContainerCmd) - statusCmd.AddCommand(statusConfigServerCmd) + rootCmd.AddCommand(statusCmd) + statusCmd.AddCommand(statusContainerCmd) + statusCmd.AddCommand(statusConfigServerCmd) } // TODO: Use deploy, query and document instead of container and config-server var statusCmd = &cobra.Command{ - Use: "status", - Short: "Verifies that a vespa target is ready to use (container by default)", - Long: `TODO`, - Run: func(cmd *cobra.Command, args []string) { - status(queryTarget(), "Container") - }, + Use: "status", + Short: "Verifies that a vespa target is ready to use (container by default)", + Long: `TODO`, + Run: func(cmd *cobra.Command, args []string) { + status(queryTarget(), "Container") + }, } var statusContainerCmd = &cobra.Command{ - Use: "container", - Short: "Verifies that your Vespa container endpoint is ready [Default]", - Long: `TODO`, - Run: func(cmd *cobra.Command, args []string) { - status(queryTarget(), "Container") - }, + Use: "container", + Short: "Verifies that your Vespa container endpoint is ready [Default]", + Long: `TODO`, + Run: func(cmd *cobra.Command, args []string) { + status(queryTarget(), "Container") + }, } var statusConfigServerCmd = &cobra.Command{ - Use: "config-server", - Short: "Verifies that your Vespa config server endpoint is ready", - Long: `TODO`, - Run: func(cmd *cobra.Command, args []string) { - status(deployTarget(), "Config server") - }, + Use: "config-server", + Short: "Verifies that your Vespa config server endpoint is ready", + Long: `TODO`, + Run: func(cmd *cobra.Command, args []string) { + status(deployTarget(), "Config server") + }, } func status(target string, description string) { - path := "/ApplicationStatus" - response := util.HttpGet(target, path, description) - if (response == nil) { - return - } - defer response.Body.Close() - - if response.StatusCode != 200 { - util.Error(description, "at", target, "is not ready") - util.Detail(response.Status) - } else { - util.Success(description, "at", target, "is ready") - } + path := "/ApplicationStatus" + response := util.HttpGet(target, path, description) + if response == nil { + return + } + defer response.Body.Close() + + if response.StatusCode != 200 { + util.Error(description, "at", target, "is not ready") + util.Detail(response.Status) + } else { + util.Success(description, "at", target, "is ready") + } } |