diff --git a/Makefile b/Makefile index 9aaa3ae..f7a861e 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,8 @@ CC_OUTPUT_TPL := ${BUILDDIR}/bin/{{.Dir}}.{{.OS}}-{{.Arch}} # some exported vars (pre-configure go build behavior) export GO111MODULE=on export CGO_ENABLED=0 +# unsure toolchains are not automatically downloaded/upgraded +export GOTOOLCHAIN=local ## enable go 1.21 loopvar "experiment" export GOEXPERIMENT=loopvar export GOBIN diff --git a/pkg/camo/helpers_test.go b/pkg/camo/helpers_test.go index a04413c..460523d 100644 --- a/pkg/camo/helpers_test.go +++ b/pkg/camo/helpers_test.go @@ -6,6 +6,7 @@ package camo import ( "encoding/json" + "errors" "fmt" "io" "net/http" @@ -123,7 +124,7 @@ func (r *Tuple[A, B]) UnmarshalJSON(p []byte) error { return err } if s != "" { - err := fmt.Errorf(s) + err := errors.New(s) r.b = err.(B) } } else { diff --git a/pkg/htrie/htrie.go b/pkg/htrie/htrie.go index 52f1280..31f0594 100644 --- a/pkg/htrie/htrie.go +++ b/pkg/htrie/htrie.go @@ -252,7 +252,8 @@ func (dt *URLMatcher) walkFind(s string) []*URLMatcher { continue } - if curnode.subtrees == nil || len(curnode.subtrees) == 0 { + // len(nil) == 0, so no need to check twice + if len(curnode.subtrees) == 0 { break }