Skip to content

Commit 2d6e43d

Browse files
committed
Rename error for tools for linter
1 parent f1407b7 commit 2d6e43d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/http/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func withInsiders(next http.Handler) http.Handler {
179179
func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
180180
inv, err := h.inventoryFactoryFunc(r)
181181
if err != nil {
182-
if errors.Is(err, inventory.UnknownToolsErr) {
182+
if errors.Is(err, inventory.ErrUnknownTools) {
183183
w.WriteHeader(http.StatusBadRequest)
184184
if _, writeErr := w.Write([]byte(err.Error())); writeErr != nil {
185185
h.logger.Error("failed to write response", "error", writeErr)

pkg/inventory/builder.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
)
1010

1111
var (
12-
// UnknownToolsErr is returned when tools specified via WithTools() are not recognized.
13-
UnknownToolsErr = errors.New("unknown tools specified in WithTools")
12+
// ErrUnknownTools is returned when tools specified via WithTools() are not recognized.
13+
ErrUnknownTools = errors.New("unknown tools specified in WithTools")
1414
)
1515

1616
// ToolFilter is a function that determines if a tool should be included.
@@ -210,7 +210,7 @@ func (b *Builder) Build() (*Inventory, error) {
210210

211211
// Error out if there are unrecognized tools
212212
if len(unrecognizedTools) > 0 {
213-
return nil, fmt.Errorf("%w: %s", UnknownToolsErr, strings.Join(unrecognizedTools, ", "))
213+
return nil, fmt.Errorf("%w: %s", ErrUnknownTools, strings.Join(unrecognizedTools, ", "))
214214
}
215215
}
216216

0 commit comments

Comments
 (0)