diff --git a/net/ghttp/ghttp_server.go b/net/ghttp/ghttp_server.go index f2e6dbf1e..01ab352fd 100644 --- a/net/ghttp/ghttp_server.go +++ b/net/ghttp/ghttp_server.go @@ -291,10 +291,7 @@ func (s *Server) Start() error { // 打印展示路由表 func (s *Server) DumpRoutesMap() { if s.config.DumpRouteMap && len(s.routesMap) > 0 { - // (等待一定时间后)当所有框架初始化信息打印完毕之后才打印路由表信息 - gtimer.SetTimeout(100*time.Millisecond, func() { - glog.Header(false).Println(fmt.Sprintf("\n%s", s.GetRouteMap())) - }) + glog.Header(false).Println(fmt.Sprintf("\n%s", s.GetRouteMap())) } } diff --git a/util/gvalid/gvalid.go b/util/gvalid/gvalid.go index 1df71b33c..4e85148cd 100644 --- a/util/gvalid/gvalid.go +++ b/util/gvalid/gvalid.go @@ -5,8 +5,6 @@ // You can obtain one at https://github.com/gogf/gf. // Package gvalid implements powerful and useful data/form validation functionality. -// -// 数据/表单校验. package gvalid import ( diff --git a/util/gvalid/gvalid_check.go b/util/gvalid/gvalid_check.go index b0728a9d6..7eb393add 100644 --- a/util/gvalid/gvalid_check.go +++ b/util/gvalid/gvalid_check.go @@ -33,75 +33,73 @@ var ( // 即使参数为空(nil|"")也需要校验的规则,主要是必需规则及关联规则 mustCheckRulesEvenValueEmpty = map[string]struct{}{ - "required": struct{}{}, - "required-if": struct{}{}, - "required-unless": struct{}{}, - "required-with": struct{}{}, - "required-with-all": struct{}{}, - "required-without": struct{}{}, - "required-without-all": struct{}{}, - "same": struct{}{}, - "different": struct{}{}, - "in": struct{}{}, - "not-in": struct{}{}, - "regex": struct{}{}, + "required": {}, + "required-if": {}, + "required-unless": {}, + "required-with": {}, + "required-with-all": {}, + "required-without": {}, + "required-without-all": {}, + "same": {}, + "different": {}, + "in": {}, + "not-in": {}, + "regex": {}, } // 所有支持的校验规则 allSupportedRules = map[string]struct{}{ - "required": struct{}{}, - "required-if": struct{}{}, - "required-unless": struct{}{}, - "required-with": struct{}{}, - "required-with-all": struct{}{}, - "required-without": struct{}{}, - "required-without-all": struct{}{}, - "date": struct{}{}, - "date-format": struct{}{}, - "email": struct{}{}, - "phone": struct{}{}, - "telephone": struct{}{}, - "passport": struct{}{}, - "password": struct{}{}, - "password2": struct{}{}, - "password3": struct{}{}, - "postcode": struct{}{}, - "id-number": struct{}{}, - "qq": struct{}{}, - "ip": struct{}{}, - "ipv4": struct{}{}, - "ipv6": struct{}{}, - "mac": struct{}{}, - "url": struct{}{}, - "domain": struct{}{}, - "length": struct{}{}, - "min-length": struct{}{}, - "max-length": struct{}{}, - "between": struct{}{}, - "min": struct{}{}, - "max": struct{}{}, - "json": struct{}{}, - "integer": struct{}{}, - "float": struct{}{}, - "boolean": struct{}{}, - "same": struct{}{}, - "different": struct{}{}, - "in": struct{}{}, - "not-in": struct{}{}, - "regex": struct{}{}, + "required": {}, + "required-if": {}, + "required-unless": {}, + "required-with": {}, + "required-with-all": {}, + "required-without": {}, + "required-without-all": {}, + "date": {}, + "date-format": {}, + "email": {}, + "phone": {}, + "telephone": {}, + "passport": {}, + "password": {}, + "password2": {}, + "password3": {}, + "postcode": {}, + "id-number": {}, + "qq": {}, + "ip": {}, + "ipv4": {}, + "ipv6": {}, + "mac": {}, + "url": {}, + "domain": {}, + "length": {}, + "min-length": {}, + "max-length": {}, + "between": {}, + "min": {}, + "max": {}, + "json": {}, + "integer": {}, + "float": {}, + "boolean": {}, + "same": {}, + "different": {}, + "in": {}, + "not-in": {}, + "regex": {}, } // 布尔Map boolMap = map[string]struct{}{ - // true - "1": struct{}{}, - "true": struct{}{}, - "on": struct{}{}, - "yes": struct{}{}, - // false - "": struct{}{}, - "0": struct{}{}, - "false": struct{}{}, - "off": struct{}{}, - "no": struct{}{}, + "1": {}, + "true": {}, + "on": {}, + "yes": {}, + "": {}, + "0": {}, + "false": {}, + "off": {}, + "no": {}, } ) diff --git a/util/gvalid/gvalid_message.go b/util/gvalid/gvalid_message.go index 15019cd22..8b926c1c6 100644 --- a/util/gvalid/gvalid_message.go +++ b/util/gvalid/gvalid_message.go @@ -4,8 +4,6 @@ // If a copy of the MIT was not distributed with this file, // You can obtain one at https://github.com/gogf/gf. -// 默认的错误消息定义。 - package gvalid // 默认规则校验错误消息(可以通过接口自定义错误消息)