From 42ff3dfa52341b54dba81acdd9e5fbd3737b8f1d Mon Sep 17 00:00:00 2001 From: 8thgencore Date: Sun, 24 Aug 2025 22:06:21 +0300 Subject: [PATCH 1/3] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20kong=20and=20?= =?UTF-8?q?testify=20dependencies=20to=20v1.12.1=20and=20v1.11.0=20respect?= =?UTF-8?q?ively?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 4 ++-- go.sum | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 94647fb..d699936 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,10 @@ module github.com/8thgencore/valchemy go 1.24.5 require ( - github.com/alecthomas/kong v1.12.0 + github.com/alecthomas/kong v1.12.1 github.com/golang-cz/devslog v0.0.15 github.com/ilyakaznacheev/cleanenv v1.5.0 - github.com/stretchr/testify v1.10.0 + github.com/stretchr/testify v1.11.0 ) require ( diff --git a/go.sum b/go.sum index 72af24d..50fd818 100644 --- a/go.sum +++ b/go.sum @@ -7,6 +7,8 @@ github.com/alecthomas/kong v1.10.0 h1:8K4rGDpT7Iu+jEXCIJUeKqvpwZHbsFRoebLbnzlmrp github.com/alecthomas/kong v1.10.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= github.com/alecthomas/kong v1.12.0 h1:oKd/0fHSdajj5PfGDd3ScvEvpVJf9mT2mb5r9xYadYM= github.com/alecthomas/kong v1.12.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= +github.com/alecthomas/kong v1.12.1 h1:iq6aMJDcFYP9uFrLdsiZQ2ZMmcshduyGv4Pek0MQPW0= +github.com/alecthomas/kong v1.12.1/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -25,6 +27,8 @@ 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/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8= +github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From edbcd35d2f7097a6b8145fb9a138fdd3c73c455d Mon Sep 17 00:00:00 2001 From: gitea Date: Sat, 14 Feb 2026 11:56:01 +0300 Subject: [PATCH 2/3] Update packages --- go.mod | 8 ++++---- go.sum | 24 ++++++++---------------- internal/config/utils.go | 4 ++-- internal/replication/replication_test.go | 1 - internal/storage/engine.go | 2 +- internal/storage/engine_test.go | 8 ++++---- internal/wal/segment/segment_test.go | 2 +- internal/wal/wal_test.go | 4 ++-- 8 files changed, 22 insertions(+), 31 deletions(-) diff --git a/go.mod b/go.mod index d699936..6363565 100644 --- a/go.mod +++ b/go.mod @@ -1,16 +1,16 @@ module github.com/8thgencore/valchemy -go 1.24.5 +go 1.25.6 require ( - github.com/alecthomas/kong v1.12.1 + github.com/alecthomas/kong v1.14.0 github.com/golang-cz/devslog v0.0.15 github.com/ilyakaznacheev/cleanenv v1.5.0 - github.com/stretchr/testify v1.11.0 + github.com/stretchr/testify v1.11.1 ) require ( - github.com/BurntSushi/toml v1.5.0 // indirect + github.com/BurntSushi/toml v1.6.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/joho/godotenv v1.5.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/go.sum b/go.sum index 50fd818..075c9f4 100644 --- a/go.sum +++ b/go.sum @@ -1,20 +1,14 @@ github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= -github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= -github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk= +github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= github.com/alecthomas/assert/v2 v2.11.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k= -github.com/alecthomas/kong v1.10.0 h1:8K4rGDpT7Iu+jEXCIJUeKqvpwZHbsFRoebLbnzlmrpw= -github.com/alecthomas/kong v1.10.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= -github.com/alecthomas/kong v1.12.0 h1:oKd/0fHSdajj5PfGDd3ScvEvpVJf9mT2mb5r9xYadYM= -github.com/alecthomas/kong v1.12.0/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= -github.com/alecthomas/kong v1.12.1 h1:iq6aMJDcFYP9uFrLdsiZQ2ZMmcshduyGv4Pek0MQPW0= -github.com/alecthomas/kong v1.12.1/go.mod h1:p2vqieVMeTAnaC83txKtXe8FLke2X07aruPWXyMPQrU= -github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= -github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= +github.com/alecthomas/kong v1.14.0 h1:gFgEUZWu2ZmZ+UhyZ1bDhuutbKN1nTtJTwh19Wsn21s= +github.com/alecthomas/kong v1.14.0/go.mod h1:wrlbXem1CWqUV5Vbmss5ISYhsVPkBb1Yo7YKJghju2I= +github.com/alecthomas/repr v0.5.2 h1:SU73FTI9D1P5UNtvseffFSGmdNci/O6RsqzeXJtP0Qs= +github.com/alecthomas/repr v0.5.2/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= 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/golang-cz/devslog v0.0.13 h1:JkJ6PPNSOCBpYyU03v3xw7WgpChQ3AYFqgRbYBhUk/Y= -github.com/golang-cz/devslog v0.0.13/go.mod h1:bSe5bm0A7Nyfqtijf1OMNgVJHlWEuVSXnkuASiE1vV8= github.com/golang-cz/devslog v0.0.15 h1:ejoBLTCwJHWGbAmDf2fyTJJQO3AkzcPjw8SC9LaOQMI= github.com/golang-cz/devslog v0.0.15/go.mod h1:bSe5bm0A7Nyfqtijf1OMNgVJHlWEuVSXnkuASiE1vV8= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= @@ -25,10 +19,8 @@ github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= -github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8= -github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/internal/config/utils.go b/internal/config/utils.go index 5d5415e..70935ad 100644 --- a/internal/config/utils.go +++ b/internal/config/utils.go @@ -34,8 +34,8 @@ func parseSize(sizeStr string) (uint64, error) { found := false for _, s := range suffixes { - if strings.HasSuffix(sizeStr, s.suffix) { - numStr = strings.TrimSuffix(sizeStr, s.suffix) + if before, ok := strings.CutSuffix(sizeStr, s.suffix); ok { + numStr = before mult = s.mult found = true break diff --git a/internal/replication/replication_test.go b/internal/replication/replication_test.go index 1cdfe4a..beea38b 100644 --- a/internal/replication/replication_test.go +++ b/internal/replication/replication_test.go @@ -1,5 +1,4 @@ //go:build !unit -// +build !unit package replication diff --git a/internal/storage/engine.go b/internal/storage/engine.go index b6884fa..895cb8c 100644 --- a/internal/storage/engine.go +++ b/internal/storage/engine.go @@ -33,7 +33,7 @@ func NewEngine(log *slog.Logger, w wal.WAL) *Engine { } // Initialize partitions - for i := 0; i < defaultNumShards; i++ { + for i := range defaultNumShards { e.partitions[i] = &partition{ data: make(map[string]string), } diff --git a/internal/storage/engine_test.go b/internal/storage/engine_test.go index a181a46..a5e4d90 100644 --- a/internal/storage/engine_test.go +++ b/internal/storage/engine_test.go @@ -121,7 +121,7 @@ func TestEngine(t *testing.T) { const iterations = 100 go func() { - for i := 0; i < iterations; i++ { + for i := range iterations { _ = engine.Set(fmt.Sprintf("key%d", i), "value") engine.Get(fmt.Sprintf("key%d", i)) } @@ -129,7 +129,7 @@ func TestEngine(t *testing.T) { }() go func() { - for i := 0; i < iterations; i++ { + for i := range iterations { engine.Get(fmt.Sprintf("key%d", i)) _ = engine.Delete(fmt.Sprintf("key%d", i)) } @@ -150,7 +150,7 @@ func TestEngine(t *testing.T) { go func() { defer wg.Done() - for i := 0; i < iterations; i++ { + for i := range iterations { err := engine.Set("key", fmt.Sprintf("value1_%d", i)) require.NoError(t, err) } @@ -158,7 +158,7 @@ func TestEngine(t *testing.T) { go func() { defer wg.Done() - for i := 0; i < iterations; i++ { + for i := range iterations { err := engine.Set("key", fmt.Sprintf("value2_%d", i)) require.NoError(t, err) } diff --git a/internal/wal/segment/segment_test.go b/internal/wal/segment/segment_test.go index cbe3b2b..33bb3d6 100644 --- a/internal/wal/segment/segment_test.go +++ b/internal/wal/segment/segment_test.go @@ -124,7 +124,7 @@ func TestListSegments(t *testing.T) { defer os.RemoveAll(dir) // Create several segments - for i := 0; i < 3; i++ { + for range 3 { s, err := NewSegment(dir) require.NoError(t, err) err = s.CreateSegmentFile() diff --git a/internal/wal/wal_test.go b/internal/wal/wal_test.go index 6a82a74..fb63c61 100644 --- a/internal/wal/wal_test.go +++ b/internal/wal/wal_test.go @@ -207,7 +207,7 @@ func TestWrite(t *testing.T) { numWrites := 20 wg.Add(numWrites) - for i := 0; i < numWrites; i++ { + for i := range numWrites { go func(i int) { defer wg.Done() err := tw.wal.Write(entry.Entry{ @@ -446,7 +446,7 @@ func TestSegmentRotation(t *testing.T) { numEntries := 5 written := make(map[string]bool) - for i := 0; i < numEntries; i++ { + for i := range numEntries { key := string(rune(i)) err := w.Write(entry.Entry{ Operation: entry.OperationSet, From eaf1afc9c3998decede592e8e01c4f08931c567b Mon Sep 17 00:00:00 2001 From: gitea Date: Sat, 14 Feb 2026 11:58:25 +0300 Subject: [PATCH 3/3] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Update=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/actions/setup-go/action.yaml | 2 +- .github/workflows/ci.yaml | 4 ++-- .github/workflows/release.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/setup-go/action.yaml b/.github/actions/setup-go/action.yaml index 35b851d..6d27e30 100644 --- a/.github/actions/setup-go/action.yaml +++ b/.github/actions/setup-go/action.yaml @@ -5,7 +5,7 @@ inputs: go-version: description: 'Go version to use' required: false - default: '1.24' + default: '1.25' cache: description: 'Enable Go module cache' required: false diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 161fd94..c2fbc78 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: ['1.24'] + go-version: ['1.25'] steps: - name: Checkout code @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: ['1.24'] + go-version: ['1.25'] steps: - name: Checkout code diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9a265e4..4ff9166 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -21,7 +21,7 @@ jobs: - name: Setup Go uses: ./.github/actions/setup-go with: - go-version: '1.24' + go-version: '1.25' - name: Run GoReleaser uses: goreleaser/goreleaser-action@v5