1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-18 22:17:44 +02:00

feat(errors): append errors use variadic arguments (#2606)

This commit is contained in:
Stanislav
2023-01-03 16:58:03 +05:00
committed by GitHub
parent 68a6425ad8
commit ad0b4f103d
2 changed files with 4 additions and 18 deletions

View File

@ -121,14 +121,7 @@ func TestAppend(t *testing.T) {
},
}
for _, e := range testData {
mError.Append(&Error{
Id: e.Id,
Code: e.Code,
Detail: e.Detail,
Status: e.Status,
})
}
mError.Append(testData...)
if len(mError.Errors) != 3 {
t.Fatalf("Expected 3 got %v", len(mError.Errors))
@ -162,14 +155,7 @@ func TestHasErrors(t *testing.T) {
t.Fatal("Expected no error")
}
for _, e := range testData {
mError.Errors = append(mError.Errors, &Error{
Id: e.Id,
Code: e.Code,
Detail: e.Detail,
Status: e.Status,
})
}
mError.Append(testData...)
if !mError.HasErrors() {
t.Fatal("Expected errors")