fix issue in empty check for nil attribute of struct in package 'empty';add set-cookie support for 302 status in ghttp.Server
package main
-import "fmt"
+import (
+ "fmt"
+ "github.com/gogf/gf/g/util/gconv"
+)
-func main() {
- for i := 0; i < 10; i++ {
- switch 1 {
- default:
- //continue
+type User struct {
+ Id int
}
- fmt.Println(i)
+
+type RPCResponse struct {
+ ID interface{} `json:"id,omitempty"`
+ JsonRPC string `json:"jsonrpc"`
+ Error *User `json:"error,omitempty"`
+ Result interface{} `json:"result,omitempty"`
}
+
+func main() {
+ var rpc RPCResponse
+ fmt.Println(rpc.Error)
+ fmt.Println(gconv.Map(rpc))
}
\ No newline at end of file
