From bcc389d10922a05fbe3e15a32ed4f255aa2e4a06 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 30 Nov 2016 13:30:03 -0500 Subject: [PATCH] Fixes gofmt -s diffs --- cmd/contact-exporter/main_test.go | 6 +++--- cmd/notify-mailer/main_test.go | 20 ++++++++++---------- grpc/creds/creds_test.go | 4 ++-- revocation/reasons.go | 10 +++++----- test/mail-test-srv/http_test.go | 14 +++++++------- va/va_test.go | 4 ++-- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/cmd/contact-exporter/main_test.go b/cmd/contact-exporter/main_test.go index 52e788dd6..d6c30c8f8 100644 --- a/cmd/contact-exporter/main_test.go +++ b/cmd/contact-exporter/main_test.go @@ -83,13 +83,13 @@ func TestFindContacts(t *testing.T) { func exampleContacts() []contact { return []contact{ - contact{ + { ID: 1, }, - contact{ + { ID: 2, }, - contact{ + { ID: 3, }, } diff --git a/cmd/notify-mailer/main_test.go b/cmd/notify-mailer/main_test.go index edc593d76..403afc21f 100644 --- a/cmd/notify-mailer/main_test.go +++ b/cmd/notify-mailer/main_test.go @@ -304,27 +304,27 @@ type mockEmailResolver struct{} func (bs mockEmailResolver) SelectOne(output interface{}, _ string, args ...interface{}) error { // The "db" is just a list in memory db := []contactJSON{ - contactJSON{ + { ID: 1, Contact: []byte(`["mailto:example@example.com"]`), }, - contactJSON{ + { ID: 2, Contact: []byte(`["mailto:test-example-updated@example.com"]`), }, - contactJSON{ + { ID: 3, Contact: []byte(`["mailto:test-test-test@example.com"]`), }, - contactJSON{ + { ID: 4, Contact: []byte(`["mailto:example-example-example@example.com"]`), }, - contactJSON{ + { ID: 5, Contact: []byte(`["mailto:youve.got.mail@example.com"]`), }, - contactJSON{ + { ID: 6, Contact: []byte(`["mailto:mail@example.com"]`), }, @@ -367,18 +367,18 @@ func TestResolveEmails(t *testing.T) { // more test cases here you must also add the corresponding DB result in the // mock. regs := []regID{ - regID{ + { ID: 1, }, - regID{ + { ID: 2, }, - regID{ + { ID: 3, }, // This registration ID deliberately doesn't exist in the mock data to make // sure this case is handled gracefully - regID{ + { ID: 999, }, } diff --git a/grpc/creds/creds_test.go b/grpc/creds/creds_test.go index dcf132eee..6545d9c67 100644 --- a/grpc/creds/creds_test.go +++ b/grpc/creds/creds_test.go @@ -19,7 +19,7 @@ import ( func TestServerTransportCredentials(t *testing.T) { acceptedSANs := map[string]struct{}{ - "boulder-client": struct{}{}, + "boulder-client": {}, } goodCert, err := core.LoadCert("../../test/grpc-creds/boulder-client/cert.pem") test.AssertNotError(t, err, "core.LoadCert('../../grpc-creds/boulder-client/cert.pem') failed") @@ -62,7 +62,7 @@ func TestServerTransportCredentials(t *testing.T) { // that has a leaf certificate containing an IP address SAN present in the // accepted list. acceptedIPSans := map[string]struct{}{ - "127.0.0.1": struct{}{}, + "127.0.0.1": {}, } bcreds = &serverTransportCredentials{servTLSConfig, acceptedIPSans} err = bcreds.validateClient(rightState) diff --git a/revocation/reasons.go b/revocation/reasons.go index d9e975e62..5e00221a9 100644 --- a/revocation/reasons.go +++ b/revocation/reasons.go @@ -38,9 +38,9 @@ var ReasonToString = map[Reason]string{ // UserAllowedReasons contains the subset of Reasons which users are // allowed to use var UserAllowedReasons = map[Reason]struct{}{ - Unspecified: struct{}{}, // unspecified - KeyCompromise: struct{}{}, // keyCompromise - AffiliationChanged: struct{}{}, // affiliationChanged - Superseded: struct{}{}, // superseded - CessationOfOperation: struct{}{}, // cessationOfOperation + Unspecified: {}, // unspecified + KeyCompromise: {}, // keyCompromise + AffiliationChanged: {}, // affiliationChanged + Superseded: {}, // superseded + CessationOfOperation: {}, // cessationOfOperation } diff --git a/test/mail-test-srv/http_test.go b/test/mail-test-srv/http_test.go index 7d4b972a4..9bfb67742 100644 --- a/test/mail-test-srv/http_test.go +++ b/test/mail-test-srv/http_test.go @@ -23,7 +23,7 @@ func reqAndRecorder(t testing.TB, method, relativeUrl string, body io.Reader) (* func TestHTTPClear(t *testing.T) { srv := mailSrv{} w, r := reqAndRecorder(t, "POST", "/clear", nil) - srv.allReceivedMail = []rcvdMail{rcvdMail{}} + srv.allReceivedMail = []rcvdMail{{}} srv.httpClear(w, r) if w.Code != 200 { t.Errorf("expected 200, got %d", w.Code) @@ -33,7 +33,7 @@ func TestHTTPClear(t *testing.T) { } w, r = reqAndRecorder(t, "GET", "/clear", nil) - srv.allReceivedMail = []rcvdMail{rcvdMail{}} + srv.allReceivedMail = []rcvdMail{{}} srv.httpClear(w, r) if w.Code != 405 { t.Errorf("expected 405, got %d", w.Code) @@ -46,11 +46,11 @@ func TestHTTPClear(t *testing.T) { func TestHTTPCount(t *testing.T) { srv := mailSrv{} srv.allReceivedMail = []rcvdMail{ - rcvdMail{From: "a", To: "b"}, - rcvdMail{From: "a", To: "b"}, - rcvdMail{From: "a", To: "c"}, - rcvdMail{From: "c", To: "a"}, - rcvdMail{From: "c", To: "b"}, + {From: "a", To: "b"}, + {From: "a", To: "b"}, + {From: "a", To: "c"}, + {From: "c", To: "a"}, + {From: "c", To: "b"}, } tests := []struct { diff --git a/va/va_test.go b/va/va_test.go index 464f95b14..bcc7aa984 100644 --- a/va/va_test.go +++ b/va/va_test.go @@ -897,12 +897,12 @@ func TestParseResults(t *testing.T) { test.Assert(t, s == nil, "set is not nil") test.Assert(t, err == nil, "error is not nil") test.AssertNotError(t, err, "no error should be returned") - r = []caaResult{{nil, errors.New("")}, {[]*dns.CAA{&dns.CAA{Value: "test"}}, nil}} + r = []caaResult{{nil, errors.New("")}, {[]*dns.CAA{{Value: "test"}}, nil}} s, err = parseResults(r) test.Assert(t, s == nil, "set is not nil") test.AssertEquals(t, err.Error(), "") expected := dns.CAA{Value: "other-test"} - r = []caaResult{{[]*dns.CAA{&expected}, nil}, {[]*dns.CAA{&dns.CAA{Value: "test"}}, nil}} + r = []caaResult{{[]*dns.CAA{&expected}, nil}, {[]*dns.CAA{{Value: "test"}}, nil}} s, err = parseResults(r) test.AssertEquals(t, len(s.Unknown), 1) test.Assert(t, s.Unknown[0] == &expected, "Incorrect record returned")