完善garray接口定义

This commit is contained in:
john
2018-10-30 18:52:47 +08:00
parent f4f57e7a91
commit c653ffa7a5
4 changed files with 8 additions and 6 deletions

2
TODO
View File

@ -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:

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}