diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 23491e7..af732e1 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,27 +1,25 @@ name: Go -on: [ pull_request ] +on: [pull_request] jobs: - build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - - name: Set up Go - uses: actions/setup-go@v3 - with: - go-version: 1.23.4 + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: 1.26.0 - - name: Golangci-lint - uses: golangci/golangci-lint-action@v6 - with: - version: v1.62.2 - args: --print-issued-lines=false --exclude-use-default=false --enable=revive --enable=goimports --enable=unconvert --concurrency=2 + - name: Golangci-lint + uses: golangci/golangci-lint-action@v9 + with: + version: v2.10.1 - - name: Test - run: go test -v ./... + - name: Test + run: go test -v ./... - - name: Build - run: go build -v ./... + - name: Build + run: go build -v ./... diff --git a/.golangci.yml b/.golangci.yml index 37c2bfa..dc2538e 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,278 +1,83 @@ -# Options for analysis running. +version: "2" run: - # The default concurrency value is the number of available CPU. - # concurrency: 4 - - # Timeout for analysis, e.g. 30s, 5m. - # Default: 1m - timeout: 10m - - # Exit code when at least one issue was found. - # Default: 1 - # issues-exit-code: 2 - - # Include test files or not. - # Default: true tests: true - - # List of build tags, all linters use it. - # Default: []. - # build-tags: - # - mytag - - # Which files to skip: they will be analyzed, but issues from them won't be reported. - # Default value is empty list, - # but there is no need to include all autogenerated files, - # we confidently recognize autogenerated files. - # If it's not please let us know. - # "/" will be replaced by current OS file path separator to properly work on Windows. - # skip-files: - # - ".*\\.my\\.go$" - # - lib/bad.go - - # If set we pass it to "go list -mod={option}". From "go help modules": - # If invoked with -mod=readonly, the go command is disallowed from the implicit - # automatic updating of go.mod described above. Instead, it fails when any changes - # to go.mod are needed. This setting is most useful to check that go.mod does - # not need updates, such as in a continuous integration and testing system. - # If invoked with -mod=vendor, the go command assumes that the vendor - # directory holds the correct copies of dependencies and ignores - # the dependency descriptions in go.mod. - # - # Allowed values: readonly|vendor|mod - # By default, it isn't set. - # modules-download-mode: readonly - - # Allow multiple parallel golangci-lint instances running. - # If false (default) - golangci-lint acquires file lock on start. allow-parallel-runners: false - - # Define the Go version limit. - # Mainly related to generics support since go1.18. - # Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.18 - # go: '1.19' - -# output configuration options output: - # The formats used to render issues. - # Formats: - # - `colored-line-number` - # - `line-number` - # - `json` - # - `colored-tab` - # - `tab` - # - `html` - # - `checkstyle` - # - `code-climate` - # - `junit-xml` - # - `junit-xml-extended` - # - `github-actions` - # - `teamcity` - # - `sarif` - # Output path can be either `stdout`, `stderr` or path to the file to write to. - # - # For the CLI flag (`--out-format`), multiple formats can be specified by separating them by comma. - # The output can be specified for each of them by separating format name and path by colon symbol. - # Example: "--out-format=checkstyle:report.xml,json:stdout,colored-line-number" - # The CLI flag (`--out-format`) override the configuration file. - # - # Default: - # formats: - # - format: colored-line-number - # path: stdout - formats: - - format: colored-line-number - - # Print lines of code with issue. - # Default: true - print-issued-lines: true - - # Print linter name in the end of issue text. - # Default: true - print-linter-name: true - - # Make issues output unique by line. - # Default: true - uniq-by-line: true - - # Add a prefix to the output file references. - # Default is no prefix. path-prefix: "" - - # Sort results by: filepath, line and column. - sort-results: false linters: - # Disable all linters. - # Default: false - disable-all: true - - # Enable specific linter - # https://golangci-lint.run/usage/linters/#enabled-by-default + default: none enable: - - revive - - goimports - - unconvert - - unparam - - gosec - bodyclose - errcheck + - exhaustive + - gosec - govet - - unused - - staticcheck - - typecheck - ineffassign - - gosimple - nilerr - - exhaustive - - # Enable all available linters. - # Default: false - # enable-all: false - - # Disable specific linter - # https://golangci-lint.run/usage/linters/#disabled-by-default - # disable: - # - asasalint - - # Enable presets. - # https://golangci-lint.run/usage/linters - # presets: - # - bugs - # - comment - # - complexity - # - error - # - format - # - import - # - metalinter - # - module - # - performance - # - sql - # - style - # - test - # - unused - - # Run only fast linters from enabled linters set (first run won't be fast) - # Default: false - fast: false + - revive + - staticcheck + - unconvert + - unparam + - unused + exclusions: + generated: lax + rules: + - linters: + - dupl + - errcheck + - gocyclo + - gosec + path: _test\.go + - linters: + - gosec + path: internal/hmac/ + text: weak cryptographic primitive + - linters: + - gosec + path: internal/ + text: "G115:" + - linters: + - gosec + path: internal/ + text: "G117:" + - linters: + - gosec + path: internal/ + text: "G704:" + - linters: + - gosec + path: internal/ + text: "G505:" + - linters: + - staticcheck + text: "SA9003:" + - linters: + - lll + source: "^//go:generate " + - path: (.+)\.go$ + text: should have a package comment + paths: + - third_party$ + - builtin$ + - examples$ issues: - # List of regexps of issue texts to exclude. - # - # But independently of this option we use default exclude patterns, - # it can be disabled by `exclude-use-default: false`. - # To list all excluded by default patterns execute `golangci-lint run --help` - # - # Default: https://golangci-lint.run/usage/false-positives/#default-exclusions - exclude: - - "should have a package comment" - - "G115" - # Excluding configuration per-path, per-linter, per-text and per-source - exclude-rules: - # Exclude some linters from running on tests files. - - path: _test\.go - linters: - - gocyclo - - errcheck - - dupl - - gosec - # Exclude known linters from partially hard-vendored code, - # which is impossible to exclude via `nolint` comments. - # `/` will be replaced by current OS file path separator to properly work on Windows. - - path: internal/hmac/ - text: "weak cryptographic primitive" - linters: - - gosec - # Exclude some `staticcheck` messages. - - linters: - - staticcheck - text: "SA9003:" - # Exclude `lll` issues for long lines with `go:generate`. - - linters: - - lll - source: "^//go:generate " - # Independently of option `exclude` we use default exclude patterns, - # it can be disabled by this option. - # To list all excluded by default patterns execute `golangci-lint run --help`. - # Default: true. - exclude-use-default: false - # If set to true exclude and exclude-rules regular expressions become case-sensitive. - # Default: false - exclude-case-sensitive: false - # Which dirs to exclude: issues from them won't be reported. - # Can use regexp here: `generated.*`, regexp is applied on full path, - # including the path prefix if one is set. - # Default dirs are skipped independently of this option's value (see exclude-dirs-use-default). - # "/" will be replaced by current OS file path separator to properly work on Windows. - # Default: [] - # exclude-dirs: - # - src/external_libs - # - autogenerated_by_my_lib - # Enables exclude of directories: - # - vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ - # Default: true - exclude-dirs-use-default: true - # The list of ids of default excludes to include or disable. - # https://golangci-lint.run/usage/false-positives/#default-exclusions - # Default: [] - # include: - # - EXC0001 - # - EXC0002 - # - EXC0003 - # - EXC0004 - # - EXC0005 - # - EXC0006 - # - EXC0007 - # - EXC0008 - # - EXC0009 - # - EXC0010 - # - EXC0011 - # - EXC0012 - # - EXC0013 - # - EXC0014 - - # Maximum issues count per one linter. - # Set to 0 to disable. - # Default: 50 max-issues-per-linter: 0 - # Maximum count of issues with the same text. - # Set to 0 to disable. - # Default: 3 max-same-issues: 0 - # Show only new issues: if there are unstaged changes or untracked files, - # only those changes are analyzed, else only changes in HEAD~ are analyzed. - # It's a super-useful option for integration of golangci-lint into existing large codebase. - # It's not practical to fix all existing issues at the moment of integration: - # much better don't allow issues in new code. - # - # Default: false. new: false - # Show only new issues created after git revision `REV`. - # new-from-rev: HEAD - # Show only new issues created in git patch with set file path. - # new-from-patch: path/to/patch/file - # Fix found issues (if it's supported by the linter). fix: true severity: - # Set the default severity for issues. - # - # If severity rules are defined and the issues do not match or no severity is provided to the rule - # this will be the default severity applied. - # Severities should match the supported severity names of the selected out format. - # - Code climate: https://docs.codeclimate.com/docs/issues#issue-severity - # - Checkstyle: https://checkstyle.sourceforge.io/property_types.html#SeverityLevel - # - GitHub: https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-error-message - # - # Default value is an empty string. - default-severity: error - # If set to true `severity-rules` regular expressions become case-sensitive. - # Default: false - case-sensitive: true - # When a list of severity rules are provided, severity information will be added to lint issues. - # Severity rules have the same filtering capability as exclude rules - # except you are allowed to specify one matcher per severity rule. - # Only affects out formats that support setting severity information. - # - # Default: [] + default: error rules: - linters: - dupl - severity: info \ No newline at end of file + severity: info +formatters: + enable: + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ + diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e08691..f4241ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,16 @@ # Ferstream + +## [v1.9.4] - 2026-05-13 +### New Features +- update go and dependencies + + -## [v1.9.3] - 2025-07-29 +## [v1.9.3] - 2025-07-30 ### Other Improvements -- upgrade go version to 1.23.4 -- upgrade library to resolve security issue +- resolve security issues from Dependabot by upgrading golang.org/x/net, golang.org/x/crypto, nats.go and nats-server ([#27](https://github.com/kumparan/ferstream/issues/27)) ([#28](https://github.com/kumparan/ferstream/issues/28)) @@ -147,7 +152,8 @@ - implement jetstream -[Unreleased]: https://github.com/kumparan/ferstream/compare/v1.9.3...HEAD +[Unreleased]: https://github.com/kumparan/ferstream/compare/v1.9.4...HEAD +[v1.9.4]: https://github.com/kumparan/ferstream/compare/v1.9.3...v1.9.4 [v1.9.3]: https://github.com/kumparan/ferstream/compare/v1.9.2...v1.9.3 [v1.9.2]: https://github.com/kumparan/ferstream/compare/v1.9.1...v1.9.2 [v1.9.1]: https://github.com/kumparan/ferstream/compare/v1.9.0...v1.9.1 diff --git a/VERSION b/VERSION index 2e1b985..cbf220c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -ferstream@v1.9.3 +ferstream@v1.9.4 diff --git a/event_message.go b/event_message.go index 00df954..8ba5b13 100644 --- a/event_message.go +++ b/event_message.go @@ -163,13 +163,13 @@ func (n *NatsEventMessage) WithEvent(e *NatsEvent) *NatsEventMessage { } // WithBody :nodoc: -func (n *NatsEventMessage) WithBody(body interface{}) *NatsEventMessage { +func (n *NatsEventMessage) WithBody(body any) *NatsEventMessage { n.Body = utils.Dump(body) return n } // WithOldBody :nodoc: -func (n *NatsEventMessage) WithOldBody(body interface{}) *NatsEventMessage { +func (n *NatsEventMessage) WithOldBody(body any) *NatsEventMessage { n.OldBody = utils.Dump(body) return n } diff --git a/go.mod b/go.mod index 74b10ff..d44d99d 100644 --- a/go.mod +++ b/go.mod @@ -1,28 +1,28 @@ module github.com/kumparan/ferstream -go 1.23.4 +go 1.26.0 require ( github.com/kumparan/tapao v1.2.0 - github.com/nats-io/nats.go v1.43.0 + github.com/nats-io/nats.go v1.52.0 github.com/pkg/errors v0.9.1 - github.com/sirupsen/logrus v1.9.3 - github.com/stretchr/testify v1.9.0 + github.com/sirupsen/logrus v1.9.4 + github.com/stretchr/testify v1.10.0 go.uber.org/mock v0.4.0 - google.golang.org/protobuf v1.34.2 + google.golang.org/protobuf v1.36.11 ) require ( github.com/aymerick/douceur v0.2.0 // indirect github.com/cockroachdb/apd v1.1.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/getsentry/sentry-go v0.28.1 // indirect + github.com/getsentry/sentry-go v0.46.2 // indirect github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 // indirect - github.com/gofrs/uuid/v5 v5.2.0 // indirect + github.com/gofrs/uuid/v5 v5.4.0 // indirect github.com/goodsign/monday v1.0.2 // indirect github.com/google/go-tpm v0.9.5 // indirect github.com/gorilla/css v1.0.1 // indirect - github.com/klauspost/compress v1.18.0 // indirect + github.com/klauspost/compress v1.18.6 // indirect github.com/kr/text v0.2.0 // indirect github.com/leekchan/accounting v1.0.0 // indirect github.com/microcosm-cc/bluemonday v1.0.27 // indirect @@ -32,21 +32,21 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/robfig/cron/v3 v3.0.1 // indirect github.com/shopspring/decimal v1.4.0 // indirect - github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect + github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/text v0.27.0 // indirect + golang.org/x/sys v0.44.0 // indirect + golang.org/x/text v0.37.0 // indirect golang.org/x/time v0.12.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) require ( - github.com/graph-gophers/graphql-go v1.5.0 // indirect - github.com/kumparan/go-utils v1.39.2 + github.com/graph-gophers/graphql-go v1.10.0 // indirect + github.com/kumparan/go-utils v1.46.0 github.com/nats-io/nats-server/v2 v2.11.6 - github.com/nats-io/nkeys v0.4.11 // indirect + github.com/nats-io/nkeys v0.4.15 // indirect github.com/nats-io/nuid v1.0.1 // indirect - golang.org/x/crypto v0.40.0 // indirect - golang.org/x/net v0.42.0 // indirect - google.golang.org/grpc v1.65.0 // indirect + golang.org/x/crypto v0.51.0 // indirect + golang.org/x/net v0.54.0 // indirect + google.golang.org/grpc v1.81.0 // indirect ) diff --git a/go.sum b/go.sum index bd56151..3830e94 100644 --- a/go.sum +++ b/go.sum @@ -7,39 +7,34 @@ github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd3 github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -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= -github.com/getsentry/sentry-go v0.28.1 h1:zzaSm/vHmGllRM6Tpx1492r0YDzauArdBfkJRtY6P5k= -github.com/getsentry/sentry-go v0.28.1/go.mod h1:1fQZ+7l7eeJ3wYi82q5Hg8GqAPgefRq+FP/QhafYVgg= +github.com/getsentry/sentry-go v0.46.2 h1:1jhYwrKGa3sIpo/y5iDNXS5wDoT7I1KNzMHrnK6ojns= +github.com/getsentry/sentry-go v0.46.2/go.mod h1:evVbw2qotNUdYG8KxXbAdjOQWWvWIwKxpjdZZIvcIPw= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8 h1:DujepqpGd1hyOd7aW59XpK7Qymp8iy83xq74fLr21is= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= -github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= -github.com/gofrs/uuid/v5 v5.2.0 h1:qw1GMx6/y8vhVsx626ImfKMuS5CvJmhIKKtuyvfajMM= -github.com/gofrs/uuid/v5 v5.2.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= +github.com/gofrs/uuid/v5 v5.4.0 h1:EfbpCTjqMuGyq5ZJwxqzn3Cbr2d0rUZU7v5ycAk/e/0= +github.com/gofrs/uuid/v5 v5.4.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/goodsign/monday v1.0.2 h1:k8kRMkCRVfCTWOU4dRfRgneQsWlB1+mJd3MxG0lGLzQ= github.com/goodsign/monday v1.0.2/go.mod h1:r4T4breXpoFwspQNM+u2sLxJb2zyTaxVGqUfTBjWOu8= -github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= -github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +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/google/go-tpm v0.9.5 h1:ocUmnDebX54dnW+MQWGQRbdaAcJELsa6PqZhJ48KwVU= github.com/google/go-tpm v0.9.5/go.mod h1:h9jEsEECg7gtLis0upRBQU+GhYVH6jMjrFxI8u6bVUY= github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8= github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0= -github.com/graph-gophers/graphql-go v1.5.0 h1:fDqblo50TEpD0LY7RXk/LFVYEVqo3+tXMNMPSVXA1yc= -github.com/graph-gophers/graphql-go v1.5.0/go.mod h1:YtmJZDLbF1YYNrlNAuiO5zAStUWc3XZT07iGsVqe1Os= -github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= -github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/graph-gophers/graphql-go v1.10.0 h1:kmfH25IW/M6ntgyz1hk+uT1j2p49ln7OFOTOzmSCfOs= +github.com/graph-gophers/graphql-go v1.10.0/go.mod h1:AsADheC4CCFwd8n1/QbkduTlHgYYMsRgtPihYVAlEsk= +github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao= +github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/kumparan/go-utils v1.39.2 h1:O1l9lTZHW6KRvmHHLBMcuhm9I67GBGRcVbBEngiPAcc= -github.com/kumparan/go-utils v1.39.2/go.mod h1:7ADYEGY5trwii2CmqbTCbFDG7EaQsPw/ET4th2D75IM= +github.com/kumparan/go-utils v1.46.0 h1:y669JTWJukttc+XwZO9t8QvumILwH7IDBCsPqUTg8tQ= +github.com/kumparan/go-utils v1.46.0/go.mod h1:FbCDVMFRXe/rIruK7LxwIu3DHuRHrSfbAGiYAbX1P+g= github.com/kumparan/tapao v1.2.0 h1:QFF6XB/Wk5quDm5tR1gPHwhgcPTADXQSP11ZEH9wAII= github.com/kumparan/tapao v1.2.0/go.mod h1:N47FrlXLNTrTuFTOTjXwIMA/0oaFq0uhnH1IxvWpxFg= github.com/leekchan/accounting v1.0.0 h1:+Wd7dJ//dFPa28rc1hjyy+qzCbXPMR91Fb6F1VGTQHg= @@ -54,15 +49,14 @@ github.com/nats-io/jwt/v2 v2.7.4 h1:jXFuDDxs/GQjGDZGhNgH4tXzSUK6WQi2rsj4xmsNOtI= github.com/nats-io/jwt/v2 v2.7.4/go.mod h1:me11pOkwObtcBNR8AiMrUbtVOUGkqYjMQZ6jnSdVUIA= github.com/nats-io/nats-server/v2 v2.11.6 h1:4VXRjbTUFKEB+7UoaKL3F5Y83xC7MxPoIONOnGgpkHw= github.com/nats-io/nats-server/v2 v2.11.6/go.mod h1:2xoztlcb4lDL5Blh1/BiukkKELXvKQ5Vy29FPVRBUYs= -github.com/nats-io/nats.go v1.43.0 h1:uRFZ2FEoRvP64+UUhaTokyS18XBCR/xM2vQZKO4i8ug= -github.com/nats-io/nats.go v1.43.0/go.mod h1:iRWIPokVIFbVijxuMQq4y9ttaBTMe0SFdlZfMDd+33g= -github.com/nats-io/nkeys v0.4.11 h1:q44qGV008kYd9W1b1nEBkNzvnWxtRSQ7A8BoqRrcfa0= -github.com/nats-io/nkeys v0.4.11/go.mod h1:szDimtgmfOi9n25JpfIdGw12tZFYXqhGxjhVxsatHVE= +github.com/nats-io/nats.go v1.52.0 h1:n3avV4VBsCgsdwh71TppsTwtv+QdPs7ntSKM8qJLGsc= +github.com/nats-io/nats.go v1.52.0/go.mod h1:26HypzazeOkyO3/mqd1zZd53STJN0EjCYF9Uy2ZOBno= +github.com/nats-io/nkeys v0.4.15 h1:JACV5jRVO9V856KOapQ7x+EY8Jo3qw1vJt/9Jpwzkk4= +github.com/nats-io/nkeys v0.4.15/go.mod h1:CpMchTXC9fxA5zrMo4KpySxNjiDVvr8ANOSZdiNfUrs= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= -github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -72,46 +66,40 @@ 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/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k= github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME= -github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= -github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -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/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= -github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= +github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= +github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= +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/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= +github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= -go.opentelemetry.io/otel v1.6.3/go.mod h1:7BgNga5fNlF/iZjG06hM3yofffp0ofKCDwSXx1GC4dI= -go.opentelemetry.io/otel/trace v1.6.3/go.mod h1:GNJQusJlUgZl9/TQBPKU/Y/ty+0iVB5fjhKeJGZPGFs= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= -golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI= +golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8= +golang.org/x/net v0.54.0 h1:2zJIZAxAHV/OHCDTCOHAYehQzLfSXuf/5SoL/Dv6w/w= +golang.org/x/net v0.54.0/go.mod h1:Sj4oj8jK6XmHpBZU/zWHw3BV3abl4Kvi+Ut7cQcY+cQ= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/sys v0.44.0 h1:ildZl3J4uzeKP07r2F++Op7E9B29JRUy+a27EibtBTQ= +golang.org/x/sys v0.44.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= -google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= -google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= -google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= +google.golang.org/grpc v1.81.0 h1:W3G9N3KQf3BU+YuCtGKJk0CmxQNbAISICD/9AORxLIw= +google.golang.org/grpc v1.81.0/go.mod h1:xGH9GfzOyMTGIOXBJmXt+BX/V0kcdQbdcuwQ/zNw42I= +google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE= +google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +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/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/jetstream_test.go b/jetstream_test.go index 1bfa3e6..2b9f069 100644 --- a/jetstream_test.go +++ b/jetstream_test.go @@ -84,7 +84,7 @@ func TestQueueSubscribe(t *testing.T) { require.NoError(t, err) - for i := 0; i < countMsg; i++ { + for range countMsg { _, err = n.Publish(subject, msgBytes) require.NoError(t, err) } @@ -95,7 +95,7 @@ func TestQueueSubscribe(t *testing.T) { }) require.NoError(t, err) - for i := 0; i < countMsg; i++ { + for range countMsg { b := <-receiverCh assert.Equal(t, msgBytes, b.Data) @@ -162,7 +162,7 @@ func TestQueueSubscribe(t *testing.T) { msgBytes, err := msg.Build() require.NoError(t, err) - for i := 0; i < countMsg; i++ { + for range countMsg { _, err = n.Publish(subject, msgBytes) require.NoError(t, err) @@ -174,7 +174,7 @@ func TestQueueSubscribe(t *testing.T) { }) require.NoError(t, err) - for i := 0; i < countMsg; i++ { + for range countMsg { b := <-receiverCh assert.Equal(t, msgBytes, b.Data) @@ -230,19 +230,19 @@ func TestSubscribe(t *testing.T) { require.NoError(t, err) - for i := 0; i < countMsg; i++ { + for range countMsg { _, err = n.Publish(subject, msgBytes) require.NoError(t, err) } - for i := 0; i < countMsg; i++ { + for range countMsg { b := <-receiverChS1 assert.Equal(t, msgBytes, b.Data) assert.Equal(t, subject, b.Subject, "test subject") } - for i := 0; i < countMsg; i++ { + for range countMsg { b := <-receiverChS2 assert.Equal(t, msgBytes, b.Data) @@ -329,20 +329,20 @@ func TestSubscribe(t *testing.T) { msgBytes, err := msg.Build() require.NoError(t, err) - for i := 0; i < countMsg; i++ { + for range countMsg { _, err = n.Publish(subject, msgBytes) require.NoError(t, err) } - for i := 0; i < countMsg; i++ { + for range countMsg { b := <-receiverChS1 assert.Equal(t, msgBytes, b.Data) assert.Equal(t, subject, b.Subject, "test subject") } - for i := 0; i < countMsg; i++ { + for range countMsg { b := <-receiverChS2 assert.Equal(t, msgBytes, b.Data)