From dffd393c0d5c9d95db9de7143a57861362763d07 Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Wed, 9 Nov 2022 14:05:27 +0100 Subject: [PATCH] Reformatting --- pkg/archive/nodelist.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/archive/nodelist.go b/pkg/archive/nodelist.go index bf5bd5c..744ce8d 100644 --- a/pkg/archive/nodelist.go +++ b/pkg/archive/nodelist.go @@ -118,23 +118,29 @@ func ParseNodeList(raw string) (NodeList, error) { exprs := []interface { consume(input string) (next string, ok bool) }{} + for i := 0; i < len(rawterm); i++ { c := rawterm[i] if isLetter(c) || isDigit(c) { j := i - for j < len(rawterm) && (isLetter(rawterm[j]) || isDigit(rawterm[j]) || isDash(rawterm[j])) { + for j < len(rawterm) && + (isLetter(rawterm[j]) || + isDigit(rawterm[j]) || + isDash(rawterm[j])) { j++ } exprs = append(exprs, NLExprString(rawterm[i:j])) i = j - 1 } else if c == '[' { end := strings.Index(rawterm[i:], "]") + if end == -1 { return nil, fmt.Errorf("node list: unclosed '['") } parts := strings.Split(rawterm[i+1:i+end], ",") nles := NLExprIntRanges{} + for _, part := range parts { minus := strings.Index(part, "-") if minus == -1 {