381 Star 2.5K Fork 616

GVPJohn / gf

 / 详情

gvaild错误转换出错

已完成
创建于  
2018-11-22 16:37

原始数据
map[Used:1049910004720603136 KeyId:1049910004724797440 Apply:1049910004720603136]
校验规则

rules := map[string]string{
		"Apply": "required|min-length:10",
		"Used":  "required|min-length:10",
		"KeyId": "required|min-length:10",
	}

调用代码

validResult := gvalid.CheckMap(data), rules)
validResult.Maps()

错误信息

/home/wwg/mydata/data/go/smartstore/src/core/error/cerror/cerror.go:10 +0x5b
vector/smartstore/src/zmvc/c/app.(*AppEvent).Add.func1()
	/home/wwg/mydata/data/go/smartstore/src/zmvc/c/app/event.go:66 +0x46
panic(0xa722c0, 0x113f6f0)
	/home/wwg/software/golang/go/src/runtime/panic.go:513 +0x1b9
gitee.com/johng/gf/g/util/gvalid.(*Error).Maps(...)
	/home/wwg/software/golang/gopath/pkg/mod/gitee.com/johng/gf@v1.2.11/g/util/gvalid/gvalid_error.go:41
vector/smartstore/src/zmvc/c/app.(*AppEvent).Add(0xc0033d9c50)
	/home/wwg/mydata/data/go/smartstore/src/zmvc/c/app/event.go:106 +0x768
reflect.Value.call(0xad4140, 0xc0033d9c50, 0x213, 0xb1b7f9, 0x4, 0x0, 0x0, 0x0, 0xc00499a088, 0x13, ...)
	/home/wwg/software/golang/go/src/reflect/value.go:447 +0x449
reflect.Value.Call(0xad4140, 0xc0033d9c50, 0x213, 0x0, 0x0, 0x0, 0xc0033d9c50, 0x213, 0x0)
	/home/wwg/software/golang/go/src/reflect/value.go:308 +0xa4
gitee.com/johng/gf/g/net/ghttp.(*Server).callServeHandler(0xc00087e480, 0xc000274ba0, 0xc001861040)
	/home/wwg/software/golang/gopath/pkg/mod/gitee.com/johng/gf@v1.2.11/g/net/ghttp/ghttp_server_handler.go:130 +0x2b3
gitee.com/johng/gf/g/net/ghttp.(*Server).handleRequest(0xc00087e480, 0xbfcde0, 0xc001f8a0e0, 0xc000238000)
	/home/wwg/software/golang/gopath/pkg/mod/gitee.com/johng/gf@v1.2.11/g/net/ghttp/ghttp_server_handler.go:90 +0x4de
gitee.com/johng/gf/g/net/ghttp.(*Server).defaultHttpHandle(0xc00087e480, 0xbfcde0, 0xc001f8a0e0, 0xc000238000)
	/home/wwg/software/golang/gopath/pkg/mod/gitee.com/johng/gf@v1.2.11/g/net/ghttp/ghttp_server_handler.go:23 +0x49
gitee.com/johng/gf/g/net/ghttp.(*Server).defaultHttpHandle-fm(0xbfcde0, 0xc001f8a0e0, 0xc000238000)
	/home/wwg/software/golang/gopath/pkg/mod/gitee.com/johng/gf@v1.2.11/g/net/ghttp/ghttp_server.go:241 +0x48
net/http.HandlerFunc.ServeHTTP(0xc00001fee0, 0xbfcde0, 0xc001f8a0e0, 0xc000238000)
	/home/wwg/software/golang/go/src/net/http/server.go:1964 +0x44
net/http.serverHandler.ServeHTTP(0xc00305aea0, 0xbfcde0, 0xc001f8a0e0, 0xc000238000)
	/home/wwg/software/golang/go/src/net/http/server.go:2741 +0xab
net/http.(*conn).serve(0xc0000af220, 0xbfd460, 0xc002a509c0)
	/home/wwg/software/golang/go/src/net/http/server.go:1847 +0x646
created by net/http.(*Server).Serve
	/home/wwg/software/golang/go/src/net/http/server.go:2851 +0x2f5

评论 (3)

Ryan Newman 创建了任务
Ryan Newman 修改了描述
John 任务状态待办的 修改为进行中
展开全部操作日志

@Ryan Newman 我还没有运行你这句代码,并且你提交的错误信息也和上次那样没有复制全,初步猜测你这个数据校验是成功的,所以发挥的*Errornil,随后你直接将nil当做*Error对象指针使用,你确定一下。

@John 确实是返回nil造成的,麻烦了

Ryan Newman 任务状态进行中 修改为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
1309327 johng 1705475649
Go
1
https://gitee.com/johng/gf.git
git@gitee.com:johng/gf.git
johng
gf
gf

搜索帮助