gf
gf copied to clipboard
[v2.7.0] gconv.Struct is not compatible with previous versions
Example
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)
}
Result
gf2.6.4
*main.Something(1) {
Value: string(5) "hello",
}
gf2.7.0
*main.Something(1) {
Value: string(5) "",
}