this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

encoding: fix two gopls warnings

First, simplify json.Pointer.Tokens so that its yield logic is simpler.
Beyond being easier to follow, this also works around a false positive
"yield may be called again" warning, which I filed a bug for at
https://github.com/golang/go/issues/75924.

Second, remove a duplicated err check in externaltest.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Id5328b0f1868e2a6836f62c04c424bd4b2971831
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1224420
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+3 -8
+3 -5
encoding/json/pointer.go
··· 55 55 for len(s) > 0 { 56 56 s = strings.TrimPrefix(s, "/") 57 57 i := min(uint(strings.IndexByte(s, '/')), uint(len(s))) 58 - var ok bool 58 + tok := s[:i] 59 59 if needUnesc { 60 - ok = yield(jsonPtrUnesc.Replace(s[:i])) 61 - } else { 62 - ok = yield(s[:i]) 60 + tok = jsonPtrUnesc.Replace(tok) 63 61 } 64 - if !ok { 62 + if !yield(tok) { 65 63 return 66 64 } 67 65 s = s[i:]
-3
encoding/jsonschema/internal/externaltest/tests.go
··· 88 88 if err != nil { 89 89 return err 90 90 } 91 - if err != nil { 92 - return err 93 - } 94 91 data = append(data, '\n') 95 92 oldData, err := os.ReadFile(filename) 96 93 if err != nil {