Skip to content

Commit 83d4b61

Browse files
committed
Apply golangci-lint autofixes
1 parent 3297ab0 commit 83d4b61

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

client/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ func GenericJSONErrorHandling(resp *resty.Response, err error) (*resty.Response,
2828
}
2929
case http.StatusInternalServerError:
3030
if !resty.IsJSONType(resp.Header().Get("Content-Type")) {
31-
return nil, fmt.Errorf("unknown error occurred, check supervisor logs with 'ha supervisor logs'")
31+
return nil, errors.New("unknown error occurred, check supervisor logs with 'ha supervisor logs'")
3232
}
3333
case http.StatusUnauthorized:
3434
if !resty.IsJSONType(resp.Header().Get("Content-Type")) {
35-
return nil, fmt.Errorf("unauthorized: missing or invalid API token")
35+
return nil, errors.New("unauthorized: missing or invalid API token")
3636
}
3737
case http.StatusForbidden:
3838
// Handle both JSON and plain text forbidden responses
3939
if !resty.IsJSONType(resp.Header().Get("Content-Type")) {
40-
return nil, fmt.Errorf("forbidden: insufficient permissions or invalid token")
40+
return nil, errors.New("forbidden: insufficient permissions or invalid token")
4141
}
4242
case http.StatusBadGateway:
43-
return nil, fmt.Errorf("bad gateway: core proxy or ingress service failure")
43+
return nil, errors.New("bad gateway: core proxy or ingress service failure")
4444
default:
4545
return nil, fmt.Errorf("unexpected server response (status: %d)", resp.StatusCode())
4646
}

cmd/docker_options.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ docker backend running on your Home Assistant system.`,
4545
if mtu == 0 {
4646
options["mtu"] = nil
4747
} else if mtu < 68 || mtu > 65535 {
48-
helper.PrintError(fmt.Errorf("MTU value must be between 68 and 65535, or 0 to reset"))
48+
helper.PrintError(errors.New("MTU value must be between 68 and 65535, or 0 to reset"))
4949
ExitWithError = true
5050
return
5151
} else {

0 commit comments

Comments
 (0)