Skip to content

Commit

Permalink
Merge pull request #346 from maxmind/greg/upgrade-golangci-lint
Browse files Browse the repository at this point in the history
Updates for new golangci-lint
  • Loading branch information
horgh authored Nov 14, 2024
2 parents e626775 + d9ff683 commit 739e5dc
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 0 additions & 6 deletions .golangci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ disable = [
# We don't follow its policy about not defining dynamic errors.
"err113",

# This doesn't seem to know about CTEs or DELETEs with RETURNING
"execinquery",

# We often don't initialize all of the struct fields. This is fine
# generally
"exhaustruct",
Expand All @@ -51,9 +48,6 @@ disable = [
"gocognit",
"godox",

# We have to disable both "gomnd" and "mnd" temporarily, apparently.
"gomnd",

# This only "caught" one thing, and it seemed like a reasonable use
# of Han script. Generally, I don't think we want to prevent the use
# of particular scripts. The time.Local checks might be useful, but
Expand Down
2 changes: 2 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import (
// Client downloads GeoIP2 and GeoLite2 MMDB databases.
//
// After creation, it is valid for concurrent use.
//
//nolint:recvcheck // changing this would be a breaking change.
type Client struct {
accountID int
endpoint string
Expand Down
8 changes: 6 additions & 2 deletions internal/geoipupdate/database/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@ type ReadResult struct {
}

// MarshalJSON is a custom json marshaler that strips out zero time fields.
func (r ReadResult) MarshalJSON() ([]byte, error) {
func (r *ReadResult) MarshalJSON() ([]byte, error) {
if r == nil {
return []byte("null"), nil
}

type partialResult ReadResult
s := &struct {
partialResult
ModifiedAt int64 `json:"modified_at,omitempty"`
CheckedAt int64 `json:"checked_at,omitempty"`
}{
partialResult: partialResult(r),
partialResult: partialResult(*r),
ModifiedAt: 0,
CheckedAt: 0,
}
Expand Down
2 changes: 1 addition & 1 deletion internal/geoipupdate/geoip_updater_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func (w *mockWriter) Write(
return nil
}

func (w mockWriter) GetHash(editionID string) (string, error) {
func (w *mockWriter) GetHash(editionID string) (string, error) {
return w.md5s[editionID], nil
}

Expand Down

0 comments on commit 739e5dc

Please sign in to comment.