From eebe9ae078990e17214c4db0ca573dab3c1a5b8f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 19:33:04 +0000 Subject: [PATCH 1/3] Bump filippo.io/edwards25519 in the go_modules group across 1 directory Bumps the go_modules group with 1 update in the / directory: [filippo.io/edwards25519](https://github.com/FiloSottile/edwards25519). Updates `filippo.io/edwards25519` from 1.1.0 to 1.1.1 - [Commits](https://github.com/FiloSottile/edwards25519/compare/v1.1.0...v1.1.1) --- updated-dependencies: - dependency-name: filippo.io/edwards25519 dependency-version: 1.1.1 dependency-type: indirect dependency-group: go_modules ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9fc5a61..9209759 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( ) require ( - filippo.io/edwards25519 v1.1.0 // indirect + filippo.io/edwards25519 v1.1.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect diff --git a/go.sum b/go.sum index aef57b9..4c8cf76 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= -filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= +filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw= +filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/alicebob/miniredis/v2 v2.35.0 h1:QwLphYqCEAo1eu1TqPRN2jgVMPBweeQcR21jeqDCONI= github.com/alicebob/miniredis/v2 v2.35.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= github.com/allegro/bigcache/v3 v3.1.0 h1:H2Vp8VOvxcrB91o86fUSVJFqeuz8kpyyB02eH3bSzwk= From 56eb7a9aec9ce3e11e4bfa431d1abe04d3d88a07 Mon Sep 17 00:00:00 2001 From: Charles Shen Date: Thu, 17 Sep 2026 18:37:02 +0800 Subject: [PATCH 2/3] fix: raise the transitive floors gorm.io/datatypes pins low, and move to go 1.26 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The bot's commit on this branch already satisfies the one alert (filippo.io/edwards25519 to 1.1.1). What it does not reach is everything else gorm.io/datatypes drags in, none of which Dependabot has opened an alert for: golang.org/x/crypto 0.23.0 -> 0.57.0 39 findings golang.org/x/text 0.20.0 -> 0.42.0 GO-2026-5970, 8 packages compiled golang.org/x/sys 0.35.0 -> 0.48.0 GO-2026-5024, 1 package compiled github.com/jackc/pgx/v5 5.5.5 -> 5.11.0 6 findings, incl. the SQL injection via dollar-quoted placeholders golang.org/x/sync 0.17.0 -> 0.23.0 (carried along) go directive 1.24.0 -> 1.26.0 All of those come from gorm.io/datatypes v1.2.7, which declares x/crypto 0.23.0, pgx 5.5.5 and x/text 0.20.0. Moving the parent is not an option — v1.2.7 is its latest release — so the floors are set directly and MVS takes it from there. go.mod also gains two indirect lines it did not have, github.com/kr/pretty 0.3.0 and gopkg.in/check.v1: they are pgx 5.11.0's test dependencies, recorded by go mod tidy. Both are clean on OSV and neither is compiled here. The go directive is the part worth explaining, because the usual rule for a library is to keep it as low as the dependencies force, and that would have been 1.25.0. It does not apply here: .github/workflows/go.yml sets `go-version-file: "go.mod"`, so this line is not only a compatibility floor for importers, it is also the toolchain CI installs. Go supports the two newest majors and today those are 1.27 and 1.26, so a 1.25 directive means CI builds on a toolchain that will not receive another stdlib fix. go1.25.14 happens to be clean right now; the point is that the next advisory against it will have no 1.25.15 to move to. 1.26.0 keeps CI on a supported line, and stdlib 1.26.8 is clean. Raising it also removes the reason x/crypto had to stop at 0.55.0: 0.56.0 is where x/crypto begins requiring go 1.26.0, and with the directive there it can go to 0.57.0, taking GO-2026-6354 and GO-2026-6355 with it. The module graph is now down to a single finding from 49 across 5 modules: GO-2026-5932 on x/crypto 0.57.0, which has no fixed version — it is the notice that x/crypto/openpgp is unmaintained — and which this module never compiles anyway (`go list -deps ./...` finds no x/crypto package; it is in go.sum only because datatypes names it). govulncheck reports nothing. Verified against the workflow's own commands: `go build -v ./...`, `go vet`, and `go test -short -p=1 -count=1 -failfast -timeout=10m -coverprofile -coverpkg` all pass at 88.4% coverage, as they did before the change. Co-Authored-By: Claude Opus 5 (1M context) --- go.mod | 12 ++++++++---- go.sum | 44 +++++++++++++++++++++++++++++--------------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 9209759..8b6998d 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/theplant/cachex -go 1.24.0 +go 1.26.0 require ( github.com/alicebob/miniredis/v2 v2.35.0 @@ -9,7 +9,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/redis/go-redis/v9 v9.16.0 github.com/stretchr/testify v1.11.1 - golang.org/x/sync v0.17.0 + golang.org/x/sync v0.23.0 gorm.io/datatypes v1.2.7 gorm.io/driver/sqlite v1.6.0 gorm.io/gorm v1.31.1 @@ -23,13 +23,17 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/go-sql-driver/mysql v1.8.1 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/jackc/pgx/v5 v5.11.0 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/mattn/go-sqlite3 v1.14.22 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/yuin/gopher-lua v1.1.1 // indirect - golang.org/x/sys v0.35.0 // indirect - golang.org/x/text v0.20.0 // indirect + golang.org/x/crypto v0.57.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gorm.io/driver/mysql v1.5.6 // indirect ) diff --git a/go.sum b/go.sum index 4c8cf76..fc5b218 100644 --- a/go.sum +++ b/go.sum @@ -10,6 +10,7 @@ github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA= github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgraph-io/ristretto/v2 v2.3.0 h1:qTQ38m7oIyd4GAed/QkUZyPFNMnvVWyazGXRwvOt5zk= @@ -31,16 +32,24 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg= -github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA= -github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= -github.com/jackc/pgx/v5 v5.5.5 h1:amBjrZVmksIdNjxGW/IiIMzxMKZFelXbUoPNb+8sjQw= -github.com/jackc/pgx/v5 v5.5.5/go.mod h1:ez9gk+OAat140fv9ErkZDYFWmXLfV+++K0uAOiwgm1A= -github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk= -github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo= +github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgx/v5 v5.11.0 h1:IzBBtyK9AHqf98cctWFifYSci2hgQR/cd56wB4p+ogg= +github.com/jackc/pgx/v5 v5.11.0/go.mod h1:mal1tBGAFfLHvZzaYh77YS/eC6IX9OWbRV1QIIM0Jn4= +github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo= +github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/microsoft/go-mssqldb v1.7.2 h1:CHkFJiObW7ItKTJfHo1QX7QBBD1iV+mn1eOyRP3b/PA= @@ -51,20 +60,25 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/redis/go-redis/v9 v9.16.0 h1:OotgqgLSRCmzfqChbQyG1PHC3tLNR89DG4jdOERSEP4= github.com/redis/go-redis/v9 v9.16.0/go.mod h1:u410H11HMLoB+TP67dz8rL9s6QW2j76l0//kSOd3370= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= -golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= -golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= -golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= -golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M= +golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gorm.io/datatypes v1.2.7 h1:ww9GAhF1aGXZY3EB3cJPJ7//JiuQo7DlQA7NNlVaTdk= From 7888bdd19ecdc36239a6a92900847836d237c0a2 Mon Sep 17 00:00:00 2001 From: Charles Shen Date: Thu, 17 Sep 2026 19:10:30 +0800 Subject: [PATCH 3/3] ci: move golangci-lint to v2, and check the Close errors it now reports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI went red on the previous commit: can't load config: the Go language version (go1.24) used to build golangci-lint is lower than the targeted Go version (1.26.0) The workflow pins golangci-lint v1.64.8, which is built with go1.24.1 and refuses any config targeting a higher Go. That is not specific to 1.26: the same binary rejects a 1.25.0 target too, so raising the directive at all would have broken this gate. The last green run on this branch was the bot's own commit, where go.mod still said 1.24.0 — not, as I said earlier, a run of the 1.25.0 version of this change, which was never pushed. The v1 line ended at v1.64.x when v2 shipped, so there is no v1 build on a newer Go to move to. The pin goes to v2.13.2 (built with go1.27.0), and the action to v9 — golangci-lint-action requires v8 or later to drive a v2 linter. v2 then reports ten unchecked `Close()` calls in tests that v1 never showed. Those are not new code and not caused by the Go bump: running v2.13.2 against the bot's commit, with go.mod back at 1.24.0, reports exactly the same ten. v1 shipped a default exclusion list that waived errcheck on Close and friends, and v2 dropped it. Since this repo carries no .golangci.yml and has always run on the defaults, the defaults are followed rather than pinned back with new config: benchmark_test.go 2 deferred l1Cache/notFoundCache Close bigcache_test.go 1 inside tb.Cleanup entry_test.go 1 deferred redis_test.go 3 one direct, two deferred transform_test.go 3 inside t.Cleanup Each becomes `_ = x.Close()`, with the deferred ones wrapped as `defer func() { _ = x.Close() }()`. No test behaviour changes — the error was discarded before and is discarded explicitly now. Verified: golangci-lint v2.13.2 reports 0 issues, and `go build -v ./...`, `go vet ./...` and `go test -short -p=1 -count=1 -failfast -timeout=10m` still pass at 88.4% coverage. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/go.yml | 4 ++-- benchmark_test.go | 4 ++-- bigcache_test.go | 2 +- entry_test.go | 2 +- redis_test.go | 6 +++--- transform_test.go | 8 ++++---- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c3d46a7..b28eb00 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -28,9 +28,9 @@ jobs: cache: true - name: Run golangci-lint - uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3 + uses: golangci/golangci-lint-action@v9 with: - version: v1.64.8 + version: v2.13.2 args: --timeout=5m - name: Build diff --git a/benchmark_test.go b/benchmark_test.go index ccfa71e..3dc56f0 100644 --- a/benchmark_test.go +++ b/benchmark_test.go @@ -201,7 +201,7 @@ func runScenario(b *testing.B, scenario BenchmarkScenario) { if err != nil { b.Fatal(err) } - defer l1Cache.Close() + defer func() { _ = l1Cache.Close() }() // Setup not-found cache // Use freshTTL + staleTTL as cache expiration @@ -211,7 +211,7 @@ func runScenario(b *testing.B, scenario BenchmarkScenario) { if err != nil { b.Fatal(err) } - defer notFoundCache.Close() + defer func() { _ = notFoundCache.Close() }() // Upstream: DB query wrapped in Entry upstream := UpstreamFunc[*Entry[*Product]](func(ctx context.Context, key string) (*Entry[*Product], error) { diff --git a/bigcache_test.go b/bigcache_test.go index ca730fa..2a3c8ff 100644 --- a/bigcache_test.go +++ b/bigcache_test.go @@ -21,7 +21,7 @@ func newBigCache(tb testing.TB) *BigCache { }, }) require.NoError(tb, err) - tb.Cleanup(func() { cache.Close() }) + tb.Cleanup(func() { _ = cache.Close() }) return cache } diff --git a/entry_test.go b/entry_test.go index 465e5b0..939c659 100644 --- a/entry_test.go +++ b/entry_test.go @@ -173,7 +173,7 @@ func TestEntryWithClient(t *testing.T) { config.TTL = 1 * time.Minute cache, err := NewRistrettoCache(config) assert.NoError(t, err) - defer cache.Close() + defer func() { _ = cache.Close() }() // Mock upstream data source fetchCount := 0 diff --git a/redis_test.go b/redis_test.go index 6d1034a..6c75ea2 100644 --- a/redis_test.go +++ b/redis_test.go @@ -25,7 +25,7 @@ func newRedisCache[T any](tb testing.TB) (*RedisCache[T], *miniredis.Miniredis) }) tb.Cleanup(func() { - client.Close() + _ = client.Close() }) cache := NewRedisCache[T](&RedisCacheConfig{ @@ -119,7 +119,7 @@ func TestRedisCacheWithTTL(t *testing.T) { Mode: "disabled", }, }) - defer client.Close() + defer func() { _ = client.Close() }() cache := NewRedisCache[string](&RedisCacheConfig{ Client: client, @@ -149,7 +149,7 @@ func TestRedisCacheConfigWithPrefix(t *testing.T) { Mode: "disabled", }, }) - defer client.Close() + defer func() { _ = client.Close() }() prodCache := NewRedisCache[string](&RedisCacheConfig{ Client: client, diff --git a/transform_test.go b/transform_test.go index 35fd03b..8ce627c 100644 --- a/transform_test.go +++ b/transform_test.go @@ -28,7 +28,7 @@ func TestTransformCacheBasics(t *testing.T) { Mode: "disabled", }, }) - t.Cleanup(func() { client.Close() }) + t.Cleanup(func() { _ = client.Close() }) // Create a Cache[string] stringCache := NewRedisCache[string](&RedisCacheConfig{ @@ -74,7 +74,7 @@ func TestJSONTransform(t *testing.T) { Mode: "disabled", }, }) - t.Cleanup(func() { client.Close() }) + t.Cleanup(func() { _ = client.Close() }) // Create a Cache[[]byte] byteCache := NewRedisCache[[]byte](&RedisCacheConfig{ @@ -117,7 +117,7 @@ func TestStringJSONTransform(t *testing.T) { Mode: "disabled", }, }) - t.Cleanup(func() { client.Close() }) + t.Cleanup(func() { _ = client.Close() }) // Create a Cache[string] stringCache := NewRedisCache[string](&RedisCacheConfig{ @@ -160,7 +160,7 @@ func TestTransformCacheErrors(t *testing.T) { Mode: "disabled", }, }) - t.Cleanup(func() { client.Close() }) + t.Cleanup(func() { _ = client.Close() }) stringCache := NewRedisCache[string](&RedisCacheConfig{ Client: client,