Slice array (#1403)

This commit is contained in:
Mike Farah
2022-10-29 18:15:21 +11:00
committed by GitHub
parent 880397d549
commit d99614f55a
10 changed files with 368 additions and 18 deletions
+2 -3
View File
@@ -3,7 +3,6 @@ package yqlib
import (
"fmt"
"regexp"
"strconv"
)
type expressionTokeniser interface {
@@ -64,11 +63,11 @@ func unwrap(value string) string {
func extractNumberParameter(value string) (int, error) {
parameterParser := regexp.MustCompile(`.*\(([0-9]+)\)`)
matches := parameterParser.FindStringSubmatch(value)
var indent, errParsingInt = strconv.ParseInt(matches[1], 10, 32)
var indent, errParsingInt = parseInt(matches[1])
if errParsingInt != nil {
return 0, errParsingInt
}
return int(indent), nil
return indent, nil
}
func hasOptionParameter(value string, option string) bool {