Skip to content

Commit

Permalink
Fix validation test
Browse files Browse the repository at this point in the history
  • Loading branch information
flycash committed Jun 6, 2020
1 parent ce0e752 commit ce4ce74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (c *JSONConfigContainer) Int(key string) (int, error) {
} else if v, ok := val.(string); ok {
return strconv.Atoi(v)
}
return 0, errors.New("not int value")
return 0, errors.New("not valid value")
}
return 0, errors.New("not exist key:" + key)
}
Expand Down
4 changes: 2 additions & 2 deletions validation/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ func TestValid(t *testing.T) {
if len(valid.Errors) != 1 {
t.Fatalf("valid errors len should be 1 but got %d", len(valid.Errors))
}
if valid.Errors[0].Key != "Age.Range" {
t.Errorf("Message key should be `Name.Match` but got %s", valid.Errors[0].Key)
if valid.Errors[0].Key != "Age.Range." {
t.Errorf("Message key should be `Age.Range` but got %s", valid.Errors[0].Key)
}
}

Expand Down

0 comments on commit ce4ce74

Please sign in to comment.