Skip to content

Commit

Permalink
fix some lint warnings/recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
dropwhile committed Aug 14, 2024
1 parent 29a896b commit 250e732
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pkg/camo/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package camo

import (
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
Expand Down Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion pkg/htrie/htrie.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 250e732

Please sign in to comment.