Skip to content

Commit

Permalink
fix: codeStats types (#39)
Browse files Browse the repository at this point in the history
* fix: codeStats types

* changelog

* lint-fix
  • Loading branch information
JulianToledano authored Feb 2, 2025
1 parent 195e2b3 commit c4acb6e
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ Ref: https://keepachangelog.com/en/1.0.0/

# Changelog

## [Unreleased]

### Bug Fixes

* [#39](https://github.com/JulianToledano/goingecko/pull/39) Change CodeStats types from int16 to int64.

## [v3.0.0](https://github.com/JulianToledano/goingecko/releases/tag/v3.0.0) - 2025.01-25

### Improvements
Expand Down
39 changes: 39 additions & 0 deletions api/coins/id_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package coins

import (
"context"
"net/http"
"testing"

"github.com/JulianToledano/goingecko/v3/api/internal"
geckohttp "github.com/JulianToledano/goingecko/v3/http"
)

func TestCoinsId(t *testing.T) {
tests := []struct {
name string
id string
}{
{
name: "stellar",
id: "stellar",
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
c := &CoinsClient{
internal.NewClient(
geckohttp.NewClient(geckohttp.WithHttpClient(http.DefaultClient)),
internal.BaseURL,
),
}
got, err := c.CoinsId(context.Background(), tt.id)
if err != nil {
t.Errorf("CoinsList() error = %v", err)
}
if got == nil {
t.Errorf("CoinsList() got = nil, want not nil")
}
})
}
}
4 changes: 2 additions & 2 deletions api/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ type DeveloperData struct {
}

type CodeStats struct {
Additions int16 `json:"additions"`
Deletions int16 `json:"deletions"`
Additions int64 `json:"additions"`
Deletions int64 `json:"deletions"`
}

type PublicInterestStats struct {
Expand Down

0 comments on commit c4acb6e

Please sign in to comment.