From a8bad0ccb2ec216964fc9ab922f8694c260899eb Mon Sep 17 00:00:00 2001 From: Julian Toledano Date: Sun, 2 Feb 2025 19:09:19 +0100 Subject: [PATCH 1/3] fix: codeStats types --- api/coins/id_test.go | 38 ++++++++++++++++++++++++++++++++++++++ api/types/types.go | 4 ++-- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 api/coins/id_test.go diff --git a/api/coins/id_test.go b/api/coins/id_test.go new file mode 100644 index 0000000..e1ab643 --- /dev/null +++ b/api/coins/id_test.go @@ -0,0 +1,38 @@ +package coins + +import ( + "context" + "github.com/JulianToledano/goingecko/v3/api/internal" + geckohttp "github.com/JulianToledano/goingecko/v3/http" + "net/http" + "testing" +) + +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") + } + }) + } +} diff --git a/api/types/types.go b/api/types/types.go index 3a4a9e8..4fcf223 100644 --- a/api/types/types.go +++ b/api/types/types.go @@ -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 { From 844aceab3e4d714a899c916e734822ee2cc5750f Mon Sep 17 00:00:00 2001 From: Julian Toledano Date: Sun, 2 Feb 2025 19:12:26 +0100 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e6d8ff..564f8bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 From f0d795f59b13af5dd49adbb30970bdc4bd7de09e Mon Sep 17 00:00:00 2001 From: Julian Toledano Date: Sun, 2 Feb 2025 19:14:38 +0100 Subject: [PATCH 3/3] lint-fix --- api/coins/id_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/coins/id_test.go b/api/coins/id_test.go index e1ab643..f35da05 100644 --- a/api/coins/id_test.go +++ b/api/coins/id_test.go @@ -2,10 +2,11 @@ package coins import ( "context" - "github.com/JulianToledano/goingecko/v3/api/internal" - geckohttp "github.com/JulianToledano/goingecko/v3/http" "net/http" "testing" + + "github.com/JulianToledano/goingecko/v3/api/internal" + geckohttp "github.com/JulianToledano/goingecko/v3/http" ) func TestCoinsId(t *testing.T) {