Fixes gofmt -s diffs

This commit is contained in:
Daniel 2016-11-30 13:30:03 -05:00
parent 78d9d02329
commit bcc389d109
No known key found for this signature in database
GPG Key ID: 08FB2BFC470E75B4
6 changed files with 29 additions and 29 deletions

View File

@ -83,13 +83,13 @@ func TestFindContacts(t *testing.T) {
func exampleContacts() []contact {
return []contact{
contact{
{
ID: 1,
},
contact{
{
ID: 2,
},
contact{
{
ID: 3,
},
}

View File

@ -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,
},
}

View File

@ -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)

View File

@ -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
}

View File

@ -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 {

View File

@ -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")