diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 783f87d8..efbdae72 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,32 +13,16 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: ["1.17.x", "1.18.x"] - include: - - go: 1.18.x - latest: true + go: ["stable", "oldstable"] steps: - - name: Setup Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go }} - - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Load cached dependencies - uses: actions/cache@v1 + - name: Setup Go + uses: actions/setup-go@v5 with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - - name: Download Dependencies - run: | - go mod download - (cd tools && go mod download) + go-version: ${{ matrix.go }} - name: Lint if: matrix.latest diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c43d4211..00000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: go -sudo: false -go: - - 1.18.x - - 1.19.x - - 1.20.x - - 1.21.x -cache: - directories: - - vendor -install: - - npm i uber-licence - - make dependencies -script: - - make test - - make lint -after_success: - - make coveralls - diff --git a/go.mod b/go.mod index 81abcb44..dd45a3c4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/uber-go/tally/v4 -go 1.15 +go 1.20 require ( github.com/cactus/go-statsd-client/v5 v5.0.0 @@ -8,10 +8,24 @@ require ( github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 github.com/prometheus/client_model v0.2.0 - github.com/stretchr/testify v1.8.0 - github.com/twmb/murmur3 v1.1.5 - go.uber.org/atomic v1.7.0 - go.uber.org/goleak v1.2.1 + github.com/stretchr/testify v1.9.0 + github.com/twmb/murmur3 v1.1.8 + go.uber.org/atomic v1.11.0 + go.uber.org/goleak v1.3.0 gopkg.in/validator.v2 v2.0.0-20200605151824-2b28d334fa05 gopkg.in/yaml.v2 v2.4.0 ) + +require ( + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/golang/protobuf v1.4.3 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/common v0.26.0 // indirect + github.com/prometheus/procfs v0.6.0 // indirect + golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 // indirect + google.golang.org/protobuf v1.26.0-rc.1 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go.sum b/go.sum index c3ff3d90..fd2d328f 100644 --- a/go.sum +++ b/go.sum @@ -12,6 +12,8 @@ github.com/cactus/go-statsd-client/v5 v5.0.0 h1:KqvIQtc9qt34uq+nu4nd1PwingWfBt/I github.com/cactus/go-statsd-client/v5 v5.0.0/go.mod h1:COEvJ1E+/E2L4q6QE5CkjWPi4eeDw9maJBMIuMPBZbY= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +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/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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= @@ -102,13 +104,21 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/twmb/murmur3 v1.1.5 h1:i9OLS9fkuLzBXjt6dptlAEyk58fJsSTXbRg3SgVyqgk= github.com/twmb/murmur3 v1.1.5/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= +github.com/twmb/murmur3 v1.1.8 h1:8Yt9taO/WN3l08xErzjeschgZU2QSrwm1kclYq+0aRg= +github.com/twmb/murmur3 v1.1.8/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= +go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -167,7 +177,6 @@ google.golang.org/protobuf v1.26.0-rc.1 h1:7QnIQpGRHE5RnLKnESfDoxm2dTapTZua5a0kS google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= 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-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/validator.v2 v2.0.0-20200605151824-2b28d334fa05 h1:l9eKDCWy9n7C5NAiQAMvDePh0vyLAweR6LcSUVXFUGg= diff --git a/internal/identity/accumulator.go b/internal/identity/accumulator.go index 83987c5c..05bcc637 100644 --- a/internal/identity/accumulator.go +++ b/internal/identity/accumulator.go @@ -37,10 +37,10 @@ type Accumulator uint64 // NewAccumulator creates a new Accumulator with a default seed value. // -// n.b. Here and elsewhere, we use nosplit to avoid stack size checks, which -// are unnecessary as memory width is bounded to each instance of `a` (a -// uint64) and, potentially, a single stack-local loop temporary while -// iterating. +// n.b. Here and elsewhere, we use nosplit to avoid stack size checks, which +// are unnecessary as memory width is bounded to each instance of `a` (a +// uint64) and, potentially, a single stack-local loop temporary while +// iterating. func NewAccumulator() Accumulator { return Accumulator(_hashSeed) } diff --git a/types.go b/types.go index 1a15971d..e51c4b47 100644 --- a/types.go +++ b/types.go @@ -29,10 +29,10 @@ import ( // Scope is a namespace wrapper around a stats reporter, ensuring that // all emitted values have a given prefix or set of tags. // -// IMPORTANT: When using Prometheus reporters, users must take care to -// not create metrics from both parent scopes and subscopes -// that have the same metric name but different tag keys, -// as metric allocation will panic. +// IMPORTANT: When using Prometheus reporters, users must take care to +// not create metrics from both parent scopes and subscopes +// that have the same metric name but different tag keys, +// as metric allocation will panic. type Scope interface { // Counter returns the Counter object corresponding to the name. Counter(name string) Counter