Merge branch 'master' of github.com:go-developer/gopkg
This commit is contained in:
commit
5939795603
@ -24,7 +24,7 @@ const (
|
||||
|
||||
// JSONode JSOM节点
|
||||
//
|
||||
// Author : zhangdeman001@ke.com<张德满>
|
||||
// Author : go_developer@163.com<张德满>
|
||||
//
|
||||
// Date : 10:33 下午 2021/3/10
|
||||
type JSONode struct {
|
||||
@ -232,11 +232,12 @@ func (dj *DynamicJSON) extraSliceIndex(key string) (bool, int) {
|
||||
// slice 至少是 [1] 格式
|
||||
return false, 0
|
||||
}
|
||||
// 不用正则,直接字符串处理
|
||||
strByte := []byte(key)
|
||||
if string(strByte[0:1]) != "[" || string(strByte[len(strByte)-1:]) != "]" {
|
||||
|
||||
if !strings.HasPrefix(key, "[") || !strings.HasSuffix(key, "]") {
|
||||
return false, 0
|
||||
}
|
||||
// 不用正则,直接字符串处理
|
||||
strByte := []byte(key)
|
||||
index, err := strconv.Atoi(string(strByte[1 : len(strByte)-1]))
|
||||
if nil != err {
|
||||
return false, 0
|
||||
|
Loading…
Reference in New Issue
Block a user