Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

Commit

Permalink
records: Break long if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomás Senart committed Aug 1, 2015
1 parent 39b6a51 commit a311c0f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions records/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,12 @@ type validationTest struct {
}

func validate(t *testing.T, i int, tc validationTest, f func([]string) error) {
if err := f(tc.in); (err == nil && tc.valid) || (err != nil && !tc.valid) {
switch err := f(tc.in); {
case (err == nil && tc.valid) || (err != nil && !tc.valid):
return // valid
} else if tc.valid {
case tc.valid:
t.Fatalf("test %d failed, unexpected error validating resolvers %v: %v", i, tc.in, err)
} else {
default:
t.Fatalf("test %d failed, expected validation error for resolvers(%d) %v", i, len(tc.in), tc.in)
}
}

0 comments on commit a311c0f

Please sign in to comment.