Address new linter complaints

This commit is contained in:
Katrina Verey
2022-03-29 18:18:23 -04:00
parent b368b347d1
commit 14947e449b
77 changed files with 220 additions and 210 deletions

View File

@@ -864,7 +864,6 @@ func TestMapEntrySetter(t *testing.T) {
assert.NotNil(t, err)
assert.Equal(t, tc.expectedErr.Error(), err.Error())
}
})
}
}
@@ -1092,15 +1091,14 @@ func (c filter) Filter(object *RNode) (*RNode, error) {
}
func TestResourceNode_Pipe(t *testing.T) {
r0, r1, r2, r3 := &RNode{}, &RNode{}, &RNode{}, &RNode{}
var r0, r1, r2, r3 *RNode
var called []string
// check the nil value case
r0 = nil
_, err := r0.Pipe(FieldMatcher{Name: "foo"})
assert.NoError(t, err)
r0 = &RNode{}
r0, r1, r2, r3 = &RNode{}, &RNode{}, &RNode{}, &RNode{}
// all filters successful
v, err := r0.Pipe(
filter{fn: func(object *RNode) (*RNode, error) {

View File

@@ -99,7 +99,6 @@ func (p *PathMatcher) filter(rn *RNode) (*RNode, error) {
}
func (p *PathMatcher) doMatchEvery(rn *RNode) (*RNode, error) {
if err := rn.VisitElements(p.visitEveryElem); err != nil {
return nil, err
}
@@ -108,7 +107,6 @@ func (p *PathMatcher) doMatchEvery(rn *RNode) (*RNode, error) {
}
func (p *PathMatcher) visitEveryElem(elem *RNode) error {
fieldName := p.Path[0]
// recurse on the matching element
pm := &PathMatcher{Path: p.Path[1:]}

View File

@@ -1168,7 +1168,6 @@ items:
assert.NotNil(t, err)
assert.Equal(t, tc.expectedErr.Error(), err.Error())
}
})
}
}

View File

@@ -67,5 +67,4 @@ func keyLineBeforeSeqElem(lines []string, seqElemIndex int) string {
return parts[0] // throw away the trailing comment part
}
return ""
}