mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-15 06:43:54 +00:00
Fix lint found by golangci-lint
This commit is contained in:
parent
14321ef959
commit
9cf189f4e0
@ -1201,13 +1201,13 @@ func (path callPath) String() string {
|
|||||||
}
|
}
|
||||||
case p.index:
|
case p.index:
|
||||||
if len(parts) > 0 {
|
if len(parts) > 0 {
|
||||||
parts[last] = parts[last] + "[i]"
|
parts[last] += "[i]"
|
||||||
} else {
|
} else {
|
||||||
parts = append(parts, "[i]")
|
parts = append(parts, "[i]")
|
||||||
}
|
}
|
||||||
case p.key:
|
case p.key:
|
||||||
if len(parts) > 0 {
|
if len(parts) > 0 {
|
||||||
parts[last] = parts[last] + "[key]"
|
parts[last] += "[key]"
|
||||||
} else {
|
} else {
|
||||||
parts = append(parts, "[key]")
|
parts = append(parts, "[key]")
|
||||||
}
|
}
|
||||||
|
@ -429,7 +429,7 @@ func hasPathPrefix(path, prefix string) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if !strings.HasSuffix(path, string(filepath.Separator)) {
|
if !strings.HasSuffix(path, string(filepath.Separator)) {
|
||||||
prefix = prefix + string(filepath.Separator)
|
prefix += string(filepath.Separator)
|
||||||
}
|
}
|
||||||
return strings.HasPrefix(path, prefix)
|
return strings.HasPrefix(path, prefix)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user