Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
test:
strategy:
matrix:
go-version: [ "1.24", "1.25" ]
go-version: [ "1.25", "1.26" ]
runs-on: ubuntu-latest
env:
GOLANGCI_LINT_VERSION: v2.4.0
GOLANGCI_LINT_VERSION: v2.9.0

steps:
- name: Checkout code
Expand Down
8 changes: 8 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ linters:
excludes:
- G103
- G115
revive:
rules:
- name: var-naming
arguments:
- []
- []
- - skip-package-name-checks: true
skip-package-name-collision-with-go-std: true
testifylint:
disable:
- float-compare
Expand Down
8 changes: 0 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ lint:
@golangci-lint run ./...
.PHONY: lint

# Generate Go files
generate:
@echo "==> Generating"
@go install -modfile go.tools.mod github.com/a8m/syncmap
@go generate
@echo "==> Done"
.PHONY: generate

# Run benchmarks
bench:
@go test -bench . ./...
Expand Down
11 changes: 0 additions & 11 deletions generate.go

This file was deleted.

5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module github.com/hamba/statter/v2

go 1.24.0
go 1.25.1

require (
github.com/VictoriaMetrics/metrics v1.40.2
github.com/cactus/go-statsd-client/v5 v5.1.0
github.com/go4org/hashtriemap v0.0.0-20251130024219-545ba229f689
github.com/hamba/logger/v2 v2.9.0
github.com/prometheus/client_golang v1.23.2
github.com/stretchr/testify v1.11.1
Expand All @@ -27,7 +28,7 @@ require (
go.opentelemetry.io/otel v1.38.0 // indirect
go.opentelemetry.io/otel/trace v1.38.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/sys v0.39.0 // indirect
google.golang.org/protobuf v1.36.8 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ 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/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw=
github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4=
github.com/go4org/hashtriemap v0.0.0-20251130024219-545ba229f689 h1:0psnKZ+N2IP43/SZC8SKx6OpFJwLmQb9m9QyV9BC2f8=
github.com/go4org/hashtriemap v0.0.0-20251130024219-545ba229f689/go.mod h1:OGmRfY/9QEK2P5zCRtmqfbCF283xPkU2dvVA4MvbvpI=
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
github.com/hamba/logger/v2 v2.9.0 h1:gLa4AuoQ17XTBovyIewOK7sALX/sHDJO3kfPUQBUA2o=
Expand Down Expand Up @@ -53,8 +55,8 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.yaml.in/yaml/v2 v2.4.2 h1:DzmwEr2rDGHl7lsFgAHxmNz/1NlQ7xLIrlN2h5d1eGI=
go.yaml.in/yaml/v2 v2.4.2/go.mod h1:081UH+NErpNdqlCXm3TtEran0rJZGxAYx9hb/ELlsPU=
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc=
google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
2 changes: 1 addition & 1 deletion internal/bytes/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Pool struct {
// NewPool creates a new instance of Pool.
func NewPool(size int) Pool {
return Pool{p: &sync.Pool{
New: func() interface{} {
New: func() any {
return &Buffer{b: make([]byte, 0, size)}
},
}}
Expand Down
7 changes: 2 additions & 5 deletions internal/bytes/buffer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ func TestPool(t *testing.T) {

var wg sync.WaitGroup
for range 10 {
wg.Add(1)
go func() {
defer wg.Done()

wg.Go(func() {
for range 100 {
buf := p.Get()
assert.Zero(t, buf.Len(), "Expected truncated Buffer")
Expand All @@ -31,7 +28,7 @@ func TestPool(t *testing.T) {

p.Put(buf)
}
}()
})
}

wg.Wait()
Expand Down
2 changes: 1 addition & 1 deletion internal/stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Pool struct {
// NewPool returns a pool.
func NewPool(percLimit int) *Pool {
return &Pool{p: &sync.Pool{
New: func() interface{} {
New: func() any {
return NewSample(percLimit)
},
}}
Expand Down
9 changes: 3 additions & 6 deletions internal/stats/stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ func TestPool(t *testing.T) {

var wg sync.WaitGroup
for range 10 {
wg.Add(1)
go func() {
defer wg.Done()

wg.Go(func() {
for range 100 {
s := p.Get()

Expand All @@ -29,7 +26,7 @@ func TestPool(t *testing.T) {

p.Put(s)
}
}()
})
}

wg.Wait()
Expand Down Expand Up @@ -87,7 +84,7 @@ func BenchmarkSample(b *testing.B) {

b.ReportAllocs()
b.ResetTimer()
for range b.N {
for b.Loop() {
s.Add(12.34)
}
}
2 changes: 1 addition & 1 deletion key.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const (
)

var keyPool = sync.Pool{
New: func() interface{} {
New: func() any {
return &key{b: make([]byte, 0, 256)}
},
}
Expand Down
Loading