Upstream gookit/config state of the touched files before db5b338b76

This commit is contained in:
upstream committed 2026-09-04 09:24:12 +02:00
1 parent cb6b9f9456
commit a78ca9b221
2 files changed
+6 -27

No files matched your search

+6 -6
View File
@@ -63,19 +63,19 @@ func (c *Config) Exists(key string, findByPath ...bool) (ok bool) {
}
case []int: // is array(is from Set)
i, err := strconv.Atoi(k)
if err != nil || i < 0 || i >= len(typeData) {
if err != nil || i >= len(typeData) {
return false
}
item = typeData[i]
case []string: // is array(is from Set)
i, err := strconv.Atoi(k)
if err != nil || i < 0 || i >= len(typeData) {
if err != nil || i >= len(typeData) {
return false
}
item = typeData[i]
case []any: // is array(load from file)
i, err := strconv.Atoi(k)
if err != nil || i < 0 || i >= len(typeData) {
if err != nil || i >= len(typeData) {
return false
}
item = typeData[i]
@@ -214,7 +214,7 @@ func (c *Config) GetValue(key string, findByPath ...bool) (value any, ok bool) {
i, err := strconv.Atoi(k)
// check slice index
if err != nil || i < 0 || len(typeData) <= i {
if err != nil || len(typeData) <= i {
ok = false
c.addError(err)
return
@@ -223,7 +223,7 @@ func (c *Config) GetValue(key string, findByPath ...bool) (value any, ok bool) {
item = typeData[i]
case []string: // is array(is from Set)
i, err := strconv.Atoi(k)
if err != nil || i < 0 || len(typeData) <= i {
if err != nil || len(typeData) <= i {
ok = false
c.addError(err)
return
@@ -232,7 +232,7 @@ func (c *Config) GetValue(key string, findByPath ...bool) (value any, ok bool) {
item = typeData[i]
case []any: // is array(load from file)
i, err := strconv.Atoi(k)
if err != nil || i < 0 || len(typeData) <= i {
if err != nil || len(typeData) <= i {
ok = false
c.addError(err)
return