We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
type S1 struct { A string B string C string } type S2 struct { A string B string C string D string E string F string G string H string I string J string K string } func main() { var json = jsoniter.ConfigCompatibleWithStandardLibrary s1str := `{"a":"1","b":"2","c":"3"}` s1 := &S1{} json.UnmarshalFromString(s1str, s1) fmt.Printf("%+v\n", s1) s2str := `{"a":"1","b":"2","c":"3","d":"4","e":"5","f":"6","g":"7","h":"8","i":"9","j":"10","k":"11"}` s2 := &S2{} json.UnmarshalFromString(s2str, s2) fmt.Printf("%+v\n", s2) }
运行结果: &{A:1 B:2 C:3} &{A: B: C: D: E: F: G: H: I: J: K:}
json库版本:1.1.3
虽然可以通过设置属性的TAG来解决,但是感觉解码行为受结构体属性个数影响导致行为不一致有点小坑,所以提出这个ISSUE。
go/reflect_struct_decoder.go
Line 515 in ca39e5a
The text was updated successfully, but these errors were encountered:
06e0f93
fix json-iterator#250 case insensitive field match
3d1a0a1
No branches or pull requests
运行结果:
&{A:1 B:2 C:3}
&{A: B: C: D: E: F: G: H: I: J: K:}
json库版本:1.1.3
虽然可以通过设置属性的TAG来解决,但是感觉解码行为受结构体属性个数影响导致行为不一致有点小坑,所以提出这个ISSUE。
go/reflect_struct_decoder.go
Line 515 in ca39e5a
其实这里也尝试了转小写去寻找fieldDecoder,只是场景可能有点多。
The text was updated successfully, but these errors were encountered: