mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-06 02:03:24 +08:00
Updating golanglint
This commit is contained in:
@@ -26,11 +26,12 @@ func popOpToResult(opStack []*token, result []*Operation) ([]*token, []*Operatio
|
||||
}
|
||||
|
||||
func validateNoOpenTokens(token *token) error {
|
||||
if token.TokenType == openCollect {
|
||||
switch token.TokenType {
|
||||
case openCollect:
|
||||
return fmt.Errorf(("bad expression, could not find matching `]`"))
|
||||
} else if token.TokenType == openCollectObject {
|
||||
case openCollectObject:
|
||||
return fmt.Errorf(("bad expression, could not find matching `}`"))
|
||||
} else if token.TokenType == openBracket {
|
||||
case openBracket:
|
||||
return fmt.Errorf(("bad expression, could not find matching `)`"))
|
||||
}
|
||||
return nil
|
||||
@@ -64,7 +65,7 @@ func (p *expressionPostFixerImpl) ConvertToPostfix(infixTokens []*token) ([]*Ope
|
||||
opStack, result = popOpToResult(opStack, result)
|
||||
}
|
||||
if len(opStack) == 0 {
|
||||
return nil, errors.New("Bad path expression, got close collect brackets without matching opening bracket")
|
||||
return nil, errors.New("bad path expression, got close collect brackets without matching opening bracket")
|
||||
}
|
||||
// now we should have [ as the last element on the opStack, get rid of it
|
||||
opStack = opStack[0 : len(opStack)-1]
|
||||
|
||||
Reference in New Issue
Block a user