mirror of
https://gitee.com/johng/gf
synced 2026-06-23 16:34:17 +08:00
完善garray接口定义
This commit is contained in:
2
TODO
2
TODO
@ -41,6 +41,8 @@ ghttp hook回调使用方式在注册路由比较多的时候,优先级可能
|
||||
https://github.com/namreg/godown
|
||||
https://github.com/Masterminds/sprig
|
||||
gform参考 https://gohouse.github.io/gorose/dist/index.html 进行改进
|
||||
完善配置管理章节,说明默认的配置文件更改方式;
|
||||
完善gform配置管理说明,g.DB/Database和gdb.New的区别;
|
||||
|
||||
|
||||
DONE:
|
||||
|
||||
@ -126,11 +126,11 @@ func (a *SortedIntArray) Slice() []int {
|
||||
|
||||
// 查找指定数值的索引位置,返回索引位置(具体匹配位置或者最后对比位置)及查找结果
|
||||
// 返回值: 最后比较位置, 比较结果
|
||||
func (a *SortedIntArray) Search(value int) (int, int) {
|
||||
func (a *SortedIntArray) Search(value int) (index int, result int) {
|
||||
return a.binSearch(value, true)
|
||||
}
|
||||
|
||||
func (a *SortedIntArray) binSearch(value int, lock bool) (int, int) {
|
||||
func (a *SortedIntArray) binSearch(value int, lock bool) (index int, result int) {
|
||||
if len(a.array) == 0 {
|
||||
return -1, -2
|
||||
}
|
||||
|
||||
@ -117,13 +117,13 @@ func (a *SortedArray) Slice() []interface{} {
|
||||
|
||||
// 查找指定数值的索引位置,返回索引位置(具体匹配位置或者最后对比位置)及查找结果
|
||||
// 返回值: 最后比较位置, 比较结果
|
||||
func (a *SortedArray) Search(value interface{}) (int, int) {
|
||||
func (a *SortedArray) Search(value interface{}) (index int, result int) {
|
||||
return a.binSearch(value, true)
|
||||
}
|
||||
|
||||
// 查找指定数值的索引位置,返回索引位置(具体匹配位置或者最后对比位置)及查找结果
|
||||
// 返回值: 最后比较位置, 比较结果
|
||||
func (a *SortedArray) binSearch(value interface{}, lock bool) (int, int) {
|
||||
func (a *SortedArray) binSearch(value interface{}, lock bool)(index int, result int) {
|
||||
if len(a.array) == 0 {
|
||||
return -1, -2
|
||||
}
|
||||
|
||||
@ -120,11 +120,11 @@ func (a *SortedStringArray) Slice() []string {
|
||||
|
||||
// 查找指定数值的索引位置,返回索引位置(具体匹配位置或者最后对比位置)及查找结果
|
||||
// 返回值: 最后比较位置, 比较结果
|
||||
func (a *SortedStringArray) Search(value string) (int, int) {
|
||||
func (a *SortedStringArray) Search(value string) (index int, result int) {
|
||||
return a.binSearch(value, true)
|
||||
}
|
||||
|
||||
func (a *SortedStringArray) binSearch(value string, lock bool) (int, int) {
|
||||
func (a *SortedStringArray) binSearch(value string, lock bool) (index int, result int) {
|
||||
if len(a.array) == 0 {
|
||||
return -1, -2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user