From 57035e4b4f9cddb6fd66949a3ebbb5ff65918c75 Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Wed, 25 May 2022 08:49:34 +0200 Subject: [PATCH] Linting --- cmd/create-account/main.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/create-account/main.go b/cmd/create-account/main.go index a26e3672c..053ffb4ec 100644 --- a/cmd/create-account/main.go +++ b/cmd/create-account/main.go @@ -23,7 +23,6 @@ import ( "encoding/json" "flag" "fmt" - "github.com/tidwall/gjson" "io" "io/ioutil" "net/http" @@ -32,11 +31,14 @@ import ( "strings" "time" + "github.com/tidwall/gjson" + + "github.com/sirupsen/logrus" + "golang.org/x/term" + "github.com/matrix-org/dendrite/setup" "github.com/matrix-org/dendrite/setup/base" "github.com/matrix-org/dendrite/userapi/storage" - "github.com/sirupsen/logrus" - "golang.org/x/term" ) const usage = `Usage: %s @@ -168,7 +170,7 @@ func sharedSecretRegister(sharedSecret, serverURL, localpart, password string, a if err != nil { return "", fmt.Errorf("failed to read response body: %w", err) } - defer nonceResp.Body.Close() + defer nonceResp.Body.Close() // nolint: errcheck nonce := gjson.GetBytes(body, "nonce").Str @@ -201,7 +203,7 @@ func sharedSecretRegister(sharedSecret, serverURL, localpart, password string, a if err != nil { return "", fmt.Errorf("unable to create account: %w", err) } - defer regResp.Body.Close() + defer regResp.Body.Close() // nolint: errcheck if regResp.StatusCode < 200 || regResp.StatusCode >= 300 { body, _ = ioutil.ReadAll(regResp.Body) return "", fmt.Errorf(gjson.GetBytes(body, "error").Str)