Updating golanglint

This commit is contained in:
Mike Farah
2025-05-03 16:34:21 +10:00
parent 89518a09b8
commit 20b5129120
29 changed files with 156 additions and 86 deletions
+4 -3
View File
@@ -22,15 +22,16 @@ func getPathArrayFromNode(funcName string, node *CandidateNode) ([]interface{},
path := make([]interface{}, len(node.Content))
for i, childNode := range node.Content {
if childNode.Tag == "!!str" {
switch childNode.Tag {
case "!!str":
path[i] = childNode.Value
} else if childNode.Tag == "!!int" {
case "!!int":
number, err := parseInt(childNode.Value)
if err != nil {
return nil, fmt.Errorf("%v: could not parse %v as an int: %w", funcName, childNode.Value, err)
}
path[i] = number
} else {
default:
return nil, fmt.Errorf("%v: expected either a !!str or !!int in the path, found %v instead", funcName, childNode.Tag)
}