Skip to content

Commit 47f2289

Browse files
committed
updating to have errors with lower E instead of upper
1 parent 01dab4d commit 47f2289

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
module github.com/ddymko/go-jsonerror
2+
3+
go 1.13

json_error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
// ErrorJSON contains an array of Errors.
88
type ErrorJSON struct {
9-
Errors []ErrorComp
9+
Errors []ErrorComp `json:"errors"`
1010
}
1111

1212
// ErrorComp is a error structure that follows the json spec.

json_error_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestErrorJSON_Error(t *testing.T) {
4040

4141
err.AddError(errorComposition)
4242

43-
errString := "{\"Errors\":[{\"status\":200,\"code\":\"This is the code\",\"title\":\"Title Test\",\"detail\":\"this is a error message\",\"source\":{\"pointer\":\"/unit/tests\"}}]}"
43+
errString := "{\"errors\":[{\"status\":200,\"code\":\"This is the code\",\"title\":\"Title Test\",\"detail\":\"this is a error message\",\"source\":{\"pointer\":\"/unit/tests\"}}]}"
4444

4545
if errString != err.Error() {
4646
t.Fatal("The err string produced did not match up")

0 commit comments

Comments
 (0)