all: make vet happy
$ go vet ./...
# cuelang.org/go/cue/errors
cue/errors/errors.go:326:15: method Is(err error, target error) bool should have signature Is(error) bool
cue/errors/errors.go:335:15: method As(err error, target interface{}) bool should have signature As(any) bool
# cuelang.org/go/cue/ast/astutil
cue/ast/astutil/resolve.go:207:6: unreachable code
The unreachable code warning is an easy one: just like in other bits of
disabled code, comment it out.
The Is/As signature warning is slightly more worrying.
Presumably due to a mistake, cue/errors.list never actually satisfied
the interfaces used by Go's errors.As and errors.Is.
The added parameter was never used, reinforcing that theory.
Adjust the two methods. We don't strictly need a regression test, given
that `go vet` will now spot that mistake in CI.
And, as per the above, add `go vet` to CI.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ie6f65a89fb41f232beede0ab732b14f0a0b831a1
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/537656
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Roger Peppe <rogpeppe@gmail.com>