Skip to content

Commit

Permalink
Don't mix receiver type
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Nov 11, 2024
1 parent c10b1ab commit ce3fc2d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion client/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type DownloadResponse struct {
//
// Returns an [HTTPError] if the server returns a non-200 status code. This
// can be used to identify problems with license.
func (c Client) Download(
func (c *Client) Download(
ctx context.Context,
editionID,
md5 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 ce3fc2d

Please sign in to comment.