Skip to content

Commit

Permalink
fix: golangci lints
Browse files Browse the repository at this point in the history
  • Loading branch information
amalucelli committed Jun 20, 2022
1 parent 8747c06 commit 3ec0fde
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
22 changes: 16 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
linters:
enable:
- thelper
- gofumpt
- tparallel
- unconvert
- unparam
- wastedassign
- errname
- errorlint
- errorlint
- godot
- goerr113
- gofmt
- gofumpt
- gosec
- misspell
- revive
- thelper
- unconvert
- unconvert
- whitespace
disable:
- structcheck
2 changes: 1 addition & 1 deletion nextdns/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func WithBaseURL(baseURL string) ClientOption {
func WithAPIKey(apiKey string) ClientOption {
return func(c *Client) error {
if apiKey == "" {
return errors.New(errEmptyAPIToken)
return errEmptyAPIToken
}

transport := authTransport{
Expand Down
4 changes: 3 additions & 1 deletion nextdns/errors.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package nextdns

import (
"errors"
"fmt"
"strings"
)

// ErrorType defines the code of an error.
type ErrorType string

var errEmptyAPIToken = errors.New("api key must not be empty")

const (
errEmptyAPIToken = "api key must not be empty"
errInternalServiceError = "internal service error received"
errResponseError = "response error received"
errMalformedError = "malformed response body received"
Expand Down

0 comments on commit 3ec0fde

Please sign in to comment.