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>