diff --git a/g/encoding/gbinary/gbinary.go b/g/encoding/gbinary/gbinary.go index 16337e98f..e53ae8583 100644 --- a/g/encoding/gbinary/gbinary.go +++ b/g/encoding/gbinary/gbinary.go @@ -4,7 +4,7 @@ // If a copy of the MIT was not distributed with this file, // You can obtain one at https://gitee.com/johng/gf. -// 二进制及byte操作管理包 +// 二进制及byte操作 package gbinary import ( diff --git a/g/encoding/gjson/gjson.go b/g/encoding/gjson/gjson.go index 06fd9a12b..b24b065ec 100644 --- a/g/encoding/gjson/gjson.go +++ b/g/encoding/gjson/gjson.go @@ -4,7 +4,7 @@ // If a copy of the MIT was not distributed with this file, // You can obtain one at https://gitee.com/johng/gf. -// 强大的JSON解析/封装包 +// JSON解析/封装 package gjson import ( diff --git a/g/frame/gcfg/gcfg.go b/g/frame/gcfg/gcfg.go index b1f1325f8..b27e0afed 100644 --- a/g/frame/gcfg/gcfg.go +++ b/g/frame/gcfg/gcfg.go @@ -4,7 +4,7 @@ // If a copy of the MIT was not distributed with this file, // You can obtain one at https://gitee.com/johng/gf. -// 全局配置管理对象,配置文件为json文件 +// 配置管理 package gcfg import ( diff --git a/g/frame/gmvc/controller.go b/g/frame/gmvc/controller.go index 814a4e531..15ab38bd6 100644 --- a/g/frame/gmvc/controller.go +++ b/g/frame/gmvc/controller.go @@ -4,7 +4,7 @@ // If a copy of the MIT was not distributed with this file, // You can obtain one at https://gitee.com/johng/gf. -// MVC控制器基类 +// MVC package gmvc import ( diff --git a/g/frame/gmvc/model.go b/g/frame/gmvc/model.go index 5939daf65..92a91aed0 100644 --- a/g/frame/gmvc/model.go +++ b/g/frame/gmvc/model.go @@ -4,9 +4,10 @@ // If a copy of the MIT was not distributed with this file, // You can obtain one at https://gitee.com/johng/gf. -// MVC模型基类 + package gmvc +// MVC模型基类 type Model struct { } \ No newline at end of file diff --git a/g/frame/gmvc/view.go b/g/frame/gmvc/view.go index 9aa0870cd..49799ec23 100644 --- a/g/frame/gmvc/view.go +++ b/g/frame/gmvc/view.go @@ -4,7 +4,6 @@ // If a copy of the MIT was not distributed with this file, // You can obtain one at https://gitee.com/johng/gf. -// MVC视图基类 package gmvc import ( @@ -15,7 +14,7 @@ import ( "gitee.com/johng/gf/g/net/ghttp" ) -// 视图对象(一个请求一个视图对象,用完即销毁) +// MVC视图基类(一个请求一个视图对象,用完即销毁) type View struct { mu sync.RWMutex // 并发互斥锁 view *gview.View // 底层视图对象 diff --git a/g/os/gcache/gcache.go b/g/os/gcache/gcache.go index bae9aa6ea..b5116b394 100644 --- a/g/os/gcache/gcache.go +++ b/g/os/gcache/gcache.go @@ -4,7 +4,7 @@ // If a copy of the MIT was not distributed with this file, // You can obtain one at https://gitee.com/johng/gf. -// 单进程缓存管理 +// 单进程缓存 package gcache import ( diff --git a/g/os/gfilespace/gfilespace.go b/g/os/gfilespace/gfilespace.go index b291c0b01..6608d2e77 100644 --- a/g/os/gfilespace/gfilespace.go +++ b/g/os/gfilespace/gfilespace.go @@ -4,7 +4,7 @@ // If a copy of the MIT was not distributed with this file, // You can obtain one at https://gitee.com/johng/gf. -// 文件空间管理, 可用于文件碎片空间维护及再利用,支持自动合并连续碎片空间 +// 文件空间管理 package gfilespace import ( diff --git a/g/util/gvalid/gvalid.go b/g/util/gvalid/gvalid.go index af56c5d7d..89b34c242 100644 --- a/g/util/gvalid/gvalid.go +++ b/g/util/gvalid/gvalid.go @@ -6,6 +6,20 @@ // 通用数据验证工具 // 本来打算取名gvalidator的,名字太长了,缩写一下 +package gvalid + +import ( + "strings" + "regexp" + "strconv" + "gitee.com/johng/gf/g/os/gtime" + "gitee.com/johng/gf/g/net/gipv4" + "gitee.com/johng/gf/g/net/gipv6" + "gitee.com/johng/gf/g/util/gregx" + "gitee.com/johng/gf/g/encoding/gjson" + "gitee.com/johng/gf/g/container/gmap" +) + /* 参考:https://laravel.com/docs/5.5/validation#available-validation-rules 规则如下: @@ -50,19 +64,6 @@ in 格式:in:value1,value2,... 说明:参 not-in 格式:not-in:value1,value2,... 说明:参数值不应该在value1,value2,...中(字符串匹配) regex 格式:regex:pattern 说明:参数值应当满足正则匹配规则pattern */ -package gvalid - -import ( - "strings" - "regexp" - "strconv" - "gitee.com/johng/gf/g/os/gtime" - "gitee.com/johng/gf/g/util/gregx" - "gitee.com/johng/gf/g/encoding/gjson" - "gitee.com/johng/gf/g/container/gmap" - "gitee.com/johng/gf/g/net/gipv6" - "gitee.com/johng/gf/g/net/gipv4" -) // 默认规则校验错误消息(可以通过接口自定义错误消息) var defaultMessages = map[string]string {