chore: make methods consistent in signatures (#1971)

* chore: make methods consistent in signatures

* test: fix fails
This commit is contained in:
Kevin Wan
2022-06-05 12:56:13 +08:00
committed by GitHub
parent 3fa8c5940d
commit 1d95e95cf8
4 changed files with 13 additions and 6 deletions

View File

@@ -1184,6 +1184,14 @@ func TestUnmarshalWithJsonNumberOptionsIncorrect(t *testing.T) {
assert.NotNil(t, UnmarshalKey(m, &in))
}
func TestUnmarshaler_UnmarshalIntOptions(t *testing.T) {
var val struct {
Sex int `json:"sex,options=0|1"`
}
input := []byte(`{"sex": 2}`)
assert.NotNil(t, UnmarshalJsonBytes(input, &val))
}
func TestUnmarshalWithUintOptionsCorrect(t *testing.T) {
type inner struct {
Value string `key:"value,options=first|second"`