Merge pull request #77479 from danielqsj/id

fix increment-decrement lint error

Kubernetes-commit: 11a46d2515ccac231a20626ef14fbb28724075f8
This commit is contained in:
Kubernetes Publisher 2019-05-07 22:14:45 -07:00
commit 1babf78c8b
4 changed files with 10 additions and 10 deletions

2
Godeps/Godeps.json generated
View File

@ -188,7 +188,7 @@
},
{
"ImportPath": "k8s.io/apimachinery",
"Rev": "a0a96b929495"
"Rev": "a3da69d3723c"
},
{
"ImportPath": "k8s.io/klog",

4
go.mod
View File

@ -27,7 +27,7 @@ require (
golang.org/x/time v0.0.0-20161028155119-f51c12702a4d
google.golang.org/appengine v1.5.0 // indirect
k8s.io/api v0.0.0-20190503110853-61630f889b3c
k8s.io/apimachinery v0.0.0-20190507223446-a0a96b929495
k8s.io/apimachinery v0.0.0-20190508063446-a3da69d3723c
k8s.io/klog v0.3.0
k8s.io/utils v0.0.0-20190221042446-c2654d5206da
sigs.k8s.io/yaml v1.1.0
@ -38,5 +38,5 @@ replace (
golang.org/x/sys => golang.org/x/sys v0.0.0-20190209173611-3b5209105503
golang.org/x/tools => golang.org/x/tools v0.0.0-20190313210603-aa82965741a9
k8s.io/api => k8s.io/api v0.0.0-20190503110853-61630f889b3c
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190507223446-a0a96b929495
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190508063446-a3da69d3723c
)

2
go.sum
View File

@ -89,7 +89,7 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWD
gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
k8s.io/api v0.0.0-20190503110853-61630f889b3c/go.mod h1:42M1T54fVvXj2R/yqB+v9ksH4xI41q6XU/NUlo3hyjk=
k8s.io/apimachinery v0.0.0-20190507223446-a0a96b929495/go.mod h1:5CBnzrKYGHzv9ZsSKmQ8wHt4XI4/TUBPDwYM9FlZMyw=
k8s.io/apimachinery v0.0.0-20190508063446-a3da69d3723c/go.mod h1:5CBnzrKYGHzv9ZsSKmQ8wHt4XI4/TUBPDwYM9FlZMyw=
k8s.io/klog v0.3.0 h1:0VPpR+sizsiivjIfIAQH/rl8tan6jvWkS7lU+0di3lE=
k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/kube-openapi v0.0.0-20190228160746-b3a7cee44a30 h1:TRb4wNWoBVrH9plmkp2q86FIDppkbrEXdXlxU3a3BMI=

View File

@ -93,17 +93,17 @@ func (j *JSONPath) FindResults(data interface{}) ([][]reflect.Value, error) {
// encounter an end node, break the current block
if j.endRange > 0 && j.endRange <= j.inRange {
j.endRange -= 1
j.endRange--
break
}
// encounter a range node, start a range loop
if j.beginRange > 0 {
j.beginRange -= 1
j.inRange += 1
j.beginRange--
j.inRange++
for k, value := range results {
j.parser.Root.Nodes = nodes[i+1:]
if k == len(results)-1 {
j.inRange -= 1
j.inRange--
}
nextResults, err := j.FindResults(value.Interface())
if err != nil {
@ -213,11 +213,11 @@ func (j *JSONPath) evalIdentifier(input []reflect.Value, node *IdentifierNode) (
switch node.Name {
case "range":
j.stack = append(j.stack, j.cur)
j.beginRange += 1
j.beginRange++
results = input
case "end":
if j.endRange < j.inRange { // inside a loop, break the current block
j.endRange += 1
j.endRange++
break
}
// the loop is about to end, pop value and continue the following execution