Skip to content

Commit e61228a

Browse files
edercarloscostalukebakken
authored andcommitted
gofmt fixes
1 parent e19806e commit e61228a

File tree

2 files changed

+40
-41
lines changed

2 files changed

+40
-41
lines changed

auth_test.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@ package amqp091
33
import "testing"
44

55
func TestPlainAuth(t *testing.T) {
6-
auth := &PlainAuth{
7-
Username: "user",
8-
Password: "pass",
9-
}
6+
auth := &PlainAuth{
7+
Username: "user",
8+
Password: "pass",
9+
}
1010

11-
if auth.Mechanism() != "PLAIN" {
12-
t.Errorf("Expected PLAIN, got %s", auth.Mechanism())
13-
}
11+
if auth.Mechanism() != "PLAIN" {
12+
t.Errorf("Expected PLAIN, got %s", auth.Mechanism())
13+
}
1414

15-
expectedResponse := "\000user\000pass"
16-
if auth.Response() != expectedResponse {
17-
t.Errorf("Expected %s, got %s", expectedResponse, auth.Response())
18-
}
15+
expectedResponse := "\000user\000pass"
16+
if auth.Response() != expectedResponse {
17+
t.Errorf("Expected %s, got %s", expectedResponse, auth.Response())
18+
}
1919
}
2020

2121
func TestExternalAuth(t *testing.T) {
22-
auth := &ExternalAuth{}
22+
auth := &ExternalAuth{}
2323

24-
if auth.Mechanism() != "EXTERNAL" {
25-
t.Errorf("Expected EXTERNAL, got %s", auth.Mechanism())
26-
}
24+
if auth.Mechanism() != "EXTERNAL" {
25+
t.Errorf("Expected EXTERNAL, got %s", auth.Mechanism())
26+
}
2727

28-
if auth.Response() != "\000*\000*" {
29-
t.Errorf("Expected \000*\000*, got %s", auth.Response())
30-
}
31-
}
28+
if auth.Response() != "\000*\000*" {
29+
t.Errorf("Expected \000*\000*, got %s", auth.Response())
30+
}
31+
}

types_test.go

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@ import (
66
)
77

88
func TestNewError(t *testing.T) {
9-
testCases := []struct {
10-
code uint16
11-
text string
12-
expectedServer bool
13-
}{
9+
testCases := []struct {
10+
code uint16
11+
text string
12+
expectedServer bool
13+
}{
1414
// Just three basics samples
15-
{404, "Not Found", true},
16-
{500, "Internal Server Error", true},
17-
{403, "Forbidden", true},
18-
}
15+
{404, "Not Found", true},
16+
{500, "Internal Server Error", true},
17+
{403, "Forbidden", true},
18+
}
1919

20-
for _, tc := range testCases {
21-
err := newError(tc.code, tc.text)
22-
if err.Code != int(tc.code) {
23-
t.Errorf("expected Code %d, got %d", tc.code, err.Code)
24-
}
25-
if err.Reason != tc.text {
26-
t.Errorf("expected Reason %s, got %s", tc.text, err.Reason)
27-
}
28-
if err.Server != tc.expectedServer {
29-
t.Errorf("expected Server to be %v", tc.expectedServer)
30-
}
31-
}
20+
for _, tc := range testCases {
21+
err := newError(tc.code, tc.text)
22+
if err.Code != int(tc.code) {
23+
t.Errorf("expected Code %d, got %d", tc.code, err.Code)
24+
}
25+
if err.Reason != tc.text {
26+
t.Errorf("expected Reason %s, got %s", tc.text, err.Reason)
27+
}
28+
if err.Server != tc.expectedServer {
29+
t.Errorf("expected Server to be %v", tc.expectedServer)
30+
}
31+
}
3232
}
3333

3434
func TestValidateField(t *testing.T) {
@@ -68,4 +68,3 @@ func TestValidateField(t *testing.T) {
6868
t.Error("validateField should fail for unsupported type but it didn't")
6969
}
7070
}
71-

0 commit comments

Comments
 (0)