Closed qinyuguang closed 6 months ago
package main import ( "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/util/gconv" "github.com/gogf/gf/v2/util/gutil" ) type Something struct { Value string `json:"value2"` } func main() { m1 := g.Map{ "Value2": "hello", } var s1 *Something _ = gconv.Struct(m1, &s1) gutil.DumpWithType(s1) }
*main.Something(1) { Value: string(5) "hello", }
*main.Something(1) { Value: string(5) "", }
@qinyuguang Version 2.7.0 updates the field matching rules, please refer to the documentation for details https://goframe.org/pages/viewpage.action?pageId=1114345
Example
Result
gf2.6.4
gf2.7.0