From 624dd0bb9dad846ce244126260d84d40df46b6e9 Mon Sep 17 00:00:00 2001 From: Alan Christopher Thomas Date: Tue, 10 Sep 2019 22:56:19 -0600 Subject: [PATCH] Fix linting errors and remove useless code --- cmd/step-ca/main.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/cmd/step-ca/main.go b/cmd/step-ca/main.go index ebb21830..a742565f 100644 --- a/cmd/step-ca/main.go +++ b/cmd/step-ca/main.go @@ -26,8 +26,8 @@ import ( ) type config struct { - Name string `json:"name"` - DNS string `json:"dns"` + Name string `json:"name"` + DNS string `json:"dns"` Address string `json:"address"` } type onboardingPayload struct { @@ -225,7 +225,11 @@ intermediate private key.`, // TODO actually initialize the CA config and start listening // TODO get the root cert fingerprint to post back to the onboarding guide payload, err := json.Marshal(onboardingPayload{Fingerprint: "foobarbatbaz"}) - req, err := http.NewRequest("POST", "http://localhost:3002/onboarding/" + token, bytes.NewBuffer(payload)) + if err != nil { + log.Fatal(err) + } + + req, err := http.NewRequest("POST", "http://localhost:3002/onboarding/"+token, bytes.NewBuffer(payload)) req.Header.Set("Content-Type", "application/json") if err != nil { log.Fatal(err) @@ -236,18 +240,13 @@ intermediate private key.`, if err != nil { log.Fatal(err) } - body, err = ioutil.ReadAll(resp.Body) - if err != nil { - log.Fatal(err) - } resp.Body.Close() fmt.Printf("Initialized!\n") fmt.Printf("Step CA has been started. Please return to the onboarding guide in your browser to continue.\n") for { - time.Sleep(1 * time.Second); + time.Sleep(1 * time.Second) } - return nil }, }, {