From 1c7d0d54116f67da19d370615d80f8998358ea7f Mon Sep 17 00:00:00 2001 From: Roland Shoemaker Date: Mon, 18 May 2015 19:03:25 -0700 Subject: [PATCH] gofmt touched files --- ra/registration-authority.go | 2 +- ra/registration-authority_test.go | 8 ++++---- sa/storage-authority_test.go | 15 +++++++-------- wfe/web-front-end_test.go | 7 +++---- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/ra/registration-authority.go b/ra/registration-authority.go index 5ebc267b2..8245faa25 100644 --- a/ra/registration-authority.go +++ b/ra/registration-authority.go @@ -13,8 +13,8 @@ import ( "strconv" "time" - "github.com/letsencrypt/boulder/core" jose "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/square/go-jose" + "github.com/letsencrypt/boulder/core" blog "github.com/letsencrypt/boulder/log" "github.com/letsencrypt/boulder/policy" ) diff --git a/ra/registration-authority_test.go b/ra/registration-authority_test.go index 55e99153c..f2faa3e90 100644 --- a/ra/registration-authority_test.go +++ b/ra/registration-authority_test.go @@ -18,9 +18,9 @@ import ( "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/cloudflare/cfssl/signer/local" _ "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/mattn/go-sqlite3" + jose "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/square/go-jose" "github.com/letsencrypt/boulder/ca" "github.com/letsencrypt/boulder/core" - jose "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/square/go-jose" "github.com/letsencrypt/boulder/policy" "github.com/letsencrypt/boulder/sa" "github.com/letsencrypt/boulder/test" @@ -242,13 +242,13 @@ func TestCertificateKeyNotEqualAccountKey(t *testing.T) { authz := core.Authorization{} authz.ID, _ = sa.NewPendingAuthorization() authz.Identifier = core.AcmeIdentifier{ - Type: core.IdentifierDNS, + Type: core.IdentifierDNS, Value: "www.example.com", } csr := x509.CertificateRequest{ SignatureAlgorithm: x509.SHA256WithRSA, - PublicKey: AccountKey.Key, - DNSNames: []string{"www.example.com"}, + PublicKey: AccountKey.Key, + DNSNames: []string{"www.example.com"}, } csrBytes, err := x509.CreateCertificateRequest(rand.Reader, &csr, AccountPrivateKey.Key) test.AssertNotError(t, err, "Failed to sign CSR") diff --git a/sa/storage-authority_test.go b/sa/storage-authority_test.go index ac4bc339d..66e76e77b 100644 --- a/sa/storage-authority_test.go +++ b/sa/storage-authority_test.go @@ -6,24 +6,24 @@ package sa import ( - "crypto/x509" - "crypto/x509/pkix" "crypto/rand" "crypto/rsa" + "crypto/x509" + "crypto/x509/pkix" "encoding/json" "fmt" "net/url" "time" _ "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/mattn/go-sqlite3" - "github.com/letsencrypt/boulder/core" jose "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/square/go-jose" + "github.com/letsencrypt/boulder/core" "github.com/letsencrypt/boulder/test" "io/ioutil" "testing" ) -func initSA(t *testing.T) (*SQLStorageAuthority) { +func initSA(t *testing.T) *SQLStorageAuthority { sa, err := NewSQLStorageAuthority("sqlite3", ":memory:") if err != nil { t.Fatalf("Failed to create SA") @@ -63,7 +63,7 @@ func TestAddRegistration(t *testing.T) { test.AssertNotError(t, err, fmt.Sprintf("Couldn't get registration with ID %v", reg.ID)) expectedReg := core.Registration{ - ID: reg.ID, + ID: reg.ID, Key: jwk, } test.AssertEquals(t, dbReg.ID, expectedReg.ID) @@ -114,8 +114,7 @@ func TestAddAuthorization(t *testing.T) { chall := core.Challenge{Type: "simpleHttps", Status: core.StatusPending, URI: u, Token: "THISWOULDNTBEAGOODTOKEN", Path: "test-me"} combos := make([][]int, 1) - combos[0] = []int{0,1} - + combos[0] = []int{0, 1} newPa := core.Authorization{ID: paID, Identifier: core.AcmeIdentifier{Type: core.IdentifierDNS, Value: "wut.com"}, RegistrationID: 0, Status: core.StatusPending, Expires: time.Now().AddDate(0, 0, 1), Challenges: []core.Challenge{chall}, Combinations: combos, Contact: []core.AcmeURL{u}} err = sa.UpdatePendingAuthorization(newPa) @@ -194,7 +193,7 @@ func TestGetCertificateByShortSerial(t *testing.T) { func TestDeniedCSR(t *testing.T) { key, _ := rsa.GenerateKey(rand.Reader, 512) template := &x509.CertificateRequest{ - Subject: pkix.Name{CommonName: "google.com"}, + Subject: pkix.Name{CommonName: "google.com"}, DNSNames: []string{"badguys.com", "reallybad.com"}, } csrBytes, _ := x509.CreateCertificateRequest(rand.Reader, template, key) diff --git a/wfe/web-front-end_test.go b/wfe/web-front-end_test.go index 416359d1b..20dfd8be4 100644 --- a/wfe/web-front-end_test.go +++ b/wfe/web-front-end_test.go @@ -18,8 +18,8 @@ import ( "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/cactus/go-statsd-client/statsd" - "github.com/letsencrypt/boulder/core" jose "github.com/letsencrypt/boulder/Godeps/_workspace/src/github.com/square/go-jose" + "github.com/letsencrypt/boulder/core" "github.com/letsencrypt/boulder/ra" "github.com/letsencrypt/boulder/test" @@ -407,7 +407,7 @@ func TestRegistration(t *testing.T) { responseWriter.Body.Reset() wfe.NewRegistration(responseWriter, &http.Request{ Method: "POST", - Body: makeBody(signRequest(t, "{\"contact\":[\"tel:123456789\"]}")), + Body: makeBody(signRequest(t, "{\"contact\":[\"tel:123456789\"]}")), }) test.AssertEquals(t, responseWriter.Body.String(), "{\"key\":{\"kty\":\"RSA\",\"n\":\"z2NsNdHeqAiGdPP8KuxfQXat_uatOK9y12SyGpfKw1sfkizBIsNxERjNDke6Wp9MugN9srN3sr2TDkmQ-gK8lfWo0v1uG_QgzJb1vBdf_hH7aejgETRGLNJZOdaKDsyFnWq1WGJq36zsHcd0qhggTk6zVwqczSxdiWIAZzEakIUZ13KxXvoepYLY0Q-rEEQiuX71e4hvhfeJ4l7m_B-awn22UUVvo3kCqmaRlZT-36vmQhDGoBsoUo1KBEU44jfeK5PbNRk7vDJuH0B7qinr_jczHcvyD-2TtPzKaCioMtNh_VZbPNDaG67sYkQlC15-Ff3HPzKKJW2XvkVG91qMvQ\",\"e\":\"AAEAAQ\"},\"recoveryToken\":\"\",\"contact\":[\"tel:123456789\"],\"thumbprint\":\"\"}") @@ -493,11 +493,10 @@ func TestAuthorization(t *testing.T) { responseWriter.Body.String(), "{\"type\":\"urn:acme:error:malformed\",\"detail\":\"Unable to read/verify body\"}") - responseWriter.Body.Reset() wfe.NewAuthorization(responseWriter, &http.Request{ Method: "POST", - Body: makeBody(signRequest(t, "{\"identifier\":{\"type\":\"dns\",\"value\":\"test.com\"}}")), + Body: makeBody(signRequest(t, "{\"identifier\":{\"type\":\"dns\",\"value\":\"test.com\"}}")), }) test.AssertEquals(t, responseWriter.Body.String(), "{\"identifier\":{\"type\":\"dns\",\"value\":\"test.com\"},\"expires\":\"0001-01-01T00:00:00Z\"}")