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 @@ -10,10 +10,10 @@ jobs:

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:
max-complexity: 15
funlen:
lines: 160
revive:
rules:
- name: var-naming
arguments:
- []
- []
- - skip-package-name-checks: true
skip-package-name-collision-with-go-std: true
exclusions:
generated: lax
rules:
Expand Down
6 changes: 2 additions & 4 deletions errors/reason/reason.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ func Extract(err error) ([]string, error) {
//nolint:errorlint // This is the only way to check for the interface.
switch x := err.(type) {
case interface{ Unwrap() []error }:
var (
reasons []string
errs []error
)
reasons := make([]string, 0, len(x.Unwrap()))
var errs []error
for _, err = range x.Unwrap() {
r, e := Extract(err)
reasons = append(reasons, r...)
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module github.com/hamba/pkg/v2

go 1.24.0

toolchain go1.24.1
go 1.25.0

require (
github.com/hamba/logger/v2 v2.9.0
Expand Down
2 changes: 1 addition & 1 deletion http/middleware/middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestRecovery(t *testing.T) {

tests := []struct {
name string
val interface{}
val any
wantLog string
}{
{
Expand Down
12 changes: 4 additions & 8 deletions wait/wait_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ func TestPollUntil(t *testing.T) {
}

func TestPollUntil_HandlesError(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
ctx := t.Context()

var count int
err := wait.PollUntil(ctx, func(context.Context) (done bool, err error) {
Expand All @@ -59,8 +58,7 @@ func TestPollUntil_HandlesError(t *testing.T) {
}

func TestPollUntil_HandlesDone(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
ctx := t.Context()

var count int
err := wait.PollUntil(ctx, func(context.Context) (done bool, err error) {
Expand Down Expand Up @@ -107,8 +105,7 @@ func TestPollImmediateUntil(t *testing.T) {
}

func TestPollImmediateUntil_HandlesImmediateError(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
ctx := t.Context()

err := wait.PollImmediateUntil(ctx, func(context.Context) (done bool, err error) {
return false, errors.New("test")
Expand All @@ -118,8 +115,7 @@ func TestPollImmediateUntil_HandlesImmediateError(t *testing.T) {
}

func TestPollImmediateUntil_HandlesImmediateDone(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
ctx := t.Context()

err := wait.PollImmediateUntil(ctx, func(context.Context) (done bool, err error) {
return true, nil
Expand Down