You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GOFMT = gofmtresult=$$(gofmt -e -l -s ${GO_FILES} ${GO_PACKAGES}); if [[ -n $$gofmtresult ]]; then echo "gofmt errors found in the following files: $${gofmtresult}"; false; fi;
16
16
GOTEST = go test --cover --race -v
17
17
18
18
bootstrap:
@@ -29,7 +29,8 @@ setup-gotools:
29
29
test: test-style test-unit
30
30
31
31
test-style:
32
-
${DEV_ENV_CMD} sh -c '${GOFMT} ${GO_FILES} ${GO_PACKAGES} && go vet $(repo_path) $(GO_PACKAGES_REPO_PATH)'
32
+
${DEV_ENV_CMD} bash -c '${GOFMT}'
33
+
${DEV_ENV_CMD} sh -c 'go vet $(repo_path) $(GO_PACKAGES_REPO_PATH)'
Copy file name to clipboardExpand all lines: errors_test.go
+31-31Lines changed: 31 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -48,218 +48,218 @@ type errorTest struct {
48
48
49
49
funcTestErrors(t*testing.T) {
50
50
tests:= []errorTest{
51
-
errorTest{
51
+
{
52
52
res: &http.Response{
53
53
StatusCode: 200,
54
54
Body: readCloser(""),
55
55
},
56
56
expected: nil,
57
57
},
58
-
errorTest{
58
+
{
59
59
res: &http.Response{
60
60
StatusCode: 201,
61
61
Body: readCloser(""),
62
62
},
63
63
expected: nil,
64
64
},
65
-
errorTest{
65
+
{
66
66
res: &http.Response{
67
67
StatusCode: 400,
68
68
Body: readCloser(`{"username":["This field is required."]}`),
69
69
},
70
70
expected: ErrInvalidUsername,
71
71
},
72
-
errorTest{
72
+
{
73
73
res: &http.Response{
74
74
StatusCode: 400,
75
75
Body: readCloser(`{"username":["Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters."]}`),
76
76
},
77
77
expected: ErrInvalidUsername,
78
78
},
79
-
errorTest{
79
+
{
80
80
res: &http.Response{
81
81
StatusCode: 400,
82
82
Body: readCloser(`{"username":["A user with that username already exists."]}`),
83
83
},
84
84
expected: ErrDuplicateUsername,
85
85
},
86
-
errorTest{
86
+
{
87
87
res: &http.Response{
88
88
StatusCode: 400,
89
89
Body: readCloser(`{"password":["This field is required."]}`),
90
90
},
91
91
expected: ErrMissingPassword,
92
92
},
93
-
errorTest{
93
+
{
94
94
res: &http.Response{
95
95
StatusCode: 400,
96
96
Body: readCloser(`{"non_field_errors":["Unable to log in with provided credentials."]}`),
97
97
},
98
98
expected: ErrLogin,
99
99
},
100
-
errorTest{
100
+
{
101
101
res: &http.Response{
102
102
StatusCode: 400,
103
103
Body: readCloser(`{"id":["App name can only contain a-z (lowercase), 0-9 and hyphens","Enter a valid \"slug\" consisting of letters, numbers, underscores or hyphens."]}`),
104
104
},
105
105
expected: ErrInvalidAppName,
106
106
},
107
-
errorTest{
107
+
{
108
108
res: &http.Response{
109
109
StatusCode: 400,
110
110
Body: readCloser(`{"id":["App with this id already exists."]}`),
111
111
},
112
112
expected: ErrDuplicateApp,
113
113
},
114
-
errorTest{
114
+
{
115
115
res: &http.Response{
116
116
StatusCode: 400,
117
117
Body: readCloser(`{"certificate": ["This field is required."]}`),
0 commit comments