-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
bugIt is confirmed a bug, but don't worry, we'll handle it.It is confirmed a bug, but don't worry, we'll handle it.
Description
Go version
go version go1.18 windows/amd64
GoFrame version
v2.7.2
Can this bug be reproduced with the latest release?
Option Yes
What did you do?
package main
import (
"fmt"
"github.com/gogf/gf/v2/util/gconv"
)
func main() {
req := map[string]any{
"id": "123",
"doc": map[string]any{
"craft": nil,
},
"fields": []string{"_id"},
}
var args *UpdateByIdReq
err := gconv.Struct(req, &args)
if err != nil {
panic(err)
}
fmt.Printf("%T", args.Doc["craft"])
}
type UpdateByIdReq struct {
Id string `json:"id" v:"required|length:24,24#id长度错误"`
Doc map[string]interface{} `json:"doc" v:"required"`
Fields []string `json:"fields"`
}
What did you see happen?
输出 *interface {}
What did you expect to see?
应该是 interface{}
Metadata
Metadata
Assignees
Labels
bugIt is confirmed a bug, but don't worry, we'll handle it.It is confirmed a bug, but don't worry, we'll handle it.