mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
remove unused variable parameters from functions
This commit is contained in:
parent
3ce266bfa0
commit
f168172bf4
@ -311,7 +311,7 @@ func opTokenWithPrefs(opType *operationType, assignOpType *operationType, prefer
|
|||||||
}
|
}
|
||||||
|
|
||||||
func expressionOpToken(expression string) yqAction {
|
func expressionOpToken(expression string) yqAction {
|
||||||
return func(rawToken lexer.Token) (*token, error) {
|
return func(_ lexer.Token) (*token, error) {
|
||||||
prefs := expressionOpPreferences{expression: expression}
|
prefs := expressionOpPreferences{expression: expression}
|
||||||
expressionOp := &Operation{OperationType: expressionOpType, Preferences: prefs}
|
expressionOp := &Operation{OperationType: expressionOpType, Preferences: prefs}
|
||||||
return &token{TokenType: operationToken, Operation: expressionOp}, nil
|
return &token{TokenType: operationToken, Operation: expressionOp}, nil
|
||||||
@ -522,7 +522,7 @@ func parentWithLevel() yqAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func parentWithDefaultLevel() yqAction {
|
func parentWithDefaultLevel() yqAction {
|
||||||
return func(rawToken lexer.Token) (*token, error) {
|
return func(_ lexer.Token) (*token, error) {
|
||||||
prefs := parentOpPreferences{Level: 1}
|
prefs := parentOpPreferences{Level: 1}
|
||||||
op := &Operation{OperationType: getParentOpType, Value: getParentOpType.Type, StringValue: getParentOpType.Type, Preferences: prefs}
|
op := &Operation{OperationType: getParentOpType, Value: getParentOpType.Type, StringValue: getParentOpType.Type, Preferences: prefs}
|
||||||
return &token{TokenType: operationToken, Operation: op, CheckForPostTraverse: true}, nil
|
return &token{TokenType: operationToken, Operation: op, CheckForPostTraverse: true}, nil
|
||||||
|
@ -7,7 +7,7 @@ type assignPreferences struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func assignUpdateFunc(prefs assignPreferences) crossFunctionCalculation {
|
func assignUpdateFunc(prefs assignPreferences) crossFunctionCalculation {
|
||||||
return func(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {
|
return func(_ *dataTreeNavigator, _ Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {
|
||||||
if !prefs.OnlyWriteNull || lhs.Tag == "!!null" {
|
if !prefs.OnlyWriteNull || lhs.Tag == "!!null" {
|
||||||
lhs.UpdateFrom(rhs, prefs)
|
lhs.UpdateFrom(rhs, prefs)
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ func compareOperator(d *dataTreeNavigator, context Context, expressionNode *Expr
|
|||||||
}
|
}
|
||||||
|
|
||||||
func compare(prefs compareTypePref) func(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {
|
func compare(prefs compareTypePref) func(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {
|
||||||
return func(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {
|
return func(_ *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {
|
||||||
log.Debugf("compare cross function")
|
log.Debugf("compare cross function")
|
||||||
if lhs == nil && rhs == nil {
|
if lhs == nil && rhs == nil {
|
||||||
owner := &CandidateNode{}
|
owner := &CandidateNode{}
|
||||||
|
@ -53,7 +53,7 @@ func sequenceFor(d *dataTreeNavigator, context Context, matchingNode *CandidateN
|
|||||||
log.Debugf("**********sequenceFor %v", NodeToString(matchingNode))
|
log.Debugf("**********sequenceFor %v", NodeToString(matchingNode))
|
||||||
|
|
||||||
mapPairs, err := crossFunction(d, context.ChildContext(matches), expressionNode,
|
mapPairs, err := crossFunction(d, context.ChildContext(matches), expressionNode,
|
||||||
func(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {
|
func(_ *dataTreeNavigator, _ Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {
|
||||||
node := &CandidateNode{Kind: MappingNode, Tag: "!!map"}
|
node := &CandidateNode{Kind: MappingNode, Tag: "!!map"}
|
||||||
|
|
||||||
log.Debugf("**********adding key %v and value %v", NodeToString(lhs), NodeToString(rhs))
|
log.Debugf("**********adding key %v and value %v", NodeToString(lhs), NodeToString(rhs))
|
||||||
|
@ -6,7 +6,7 @@ func equalsOperator(d *dataTreeNavigator, context Context, expressionNode *Expre
|
|||||||
}
|
}
|
||||||
|
|
||||||
func isEquals(flip bool) func(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {
|
func isEquals(flip bool) func(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {
|
||||||
return func(d *dataTreeNavigator, context Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {
|
return func(_ *dataTreeNavigator, _ Context, lhs *CandidateNode, rhs *CandidateNode) (*CandidateNode, error) {
|
||||||
value := false
|
value := false
|
||||||
log.Debugf("isEquals cross function")
|
log.Debugf("isEquals cross function")
|
||||||
if lhs == nil && rhs == nil {
|
if lhs == nil && rhs == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user