Skip to content

Commit 7ec2e89

Browse files
authored
Updates (#83)
* Updates * Bumping versions in GHA too * Bumping golangci-lint to match the other go versions * Linter updates
1 parent 8bf43db commit 7ec2e89

File tree

16 files changed

+29
-45
lines changed

16 files changed

+29
-45
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
- name: golangci-lint
1818
uses: golangci/golangci-lint-action@v8
1919
with:
20-
version: v2.1
20+
version: v2.8.0

.github/workflows/pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup Go
1616
uses: actions/setup-go@v5
1717
with:
18-
go-version: "1.24.x"
18+
go-version: "1.25.x"
1919
- run: go version
2020

2121
- name: Install dependencies

.github/workflows/push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup Go
1616
uses: actions/setup-go@v5
1717
with:
18-
go-version: "1.24.x"
18+
go-version: "1.25.x"
1919
- run: go version
2020

2121
- name: Install dependencies

.golangci.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ linters:
1717
- unconvert
1818
- unparam
1919
- unused
20-
- wsl
20+
- wsl_v5
2121
settings:
2222
errcheck:
2323
check-type-assertions: false
@@ -38,12 +38,15 @@ linters:
3838
ignored-numbers:
3939
- "2"
4040
- "0644"
41-
42-
wsl:
43-
strict-append: false
44-
allow-separated-leading-comment: true
45-
allow-cuddle-declarations: true
46-
force-short-decl-cuddling: true
41+
wsl_v5:
42+
allow-first-in-block: true
43+
allow-whole-block: false
44+
branch-max-lines: 2
45+
enable:
46+
- assign-exclusive
47+
disable:
48+
- append
49+
- decl
4750
exclusions:
4851
generated: lax
4952
presets:

functions/post_form_url_encoded.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,11 @@ func PostFormURLEncoded(existingHeaders map[string]string, args []string) (strin
4747
client.Timeout = time.Second * timeoutSeconds
4848

4949
response, err := client.PostForm(endpoint, requestBody)
50-
5150
if err != nil {
5251
return "", err
5352
}
5453

5554
responseBody, err := io.ReadAll(response.Body)
56-
5755
if err != nil {
5856
return "", err
5957
}

functions/sign_string_rs256_pkcs8.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ func SignStringRS256PKCS8(existingHeaders map[string]string, args []string) (str
2323
}
2424

2525
key, passphrase, err := argsToKeyPassphrase(args)
26-
2726
if err != nil {
2827
return "", fmt.Errorf("error calling SignStringRS256PKCS8; %w", err)
2928
}
@@ -36,7 +35,6 @@ func SignStringRS256PKCS8(existingHeaders map[string]string, args []string) (str
3635

3736
// Parse the key, decrypting it if necessary
3837
decryptedKey, err := pkcs8.ParsePKCS8PrivateKey(pemBlock.Bytes, []byte(passphrase))
39-
4038
if err != nil {
4139
return "", fmt.Errorf("error calling SignStringRS256PKCS8; unable to parse private key: %w", err)
4240
}
@@ -55,7 +53,6 @@ func SignStringRS256PKCS8(existingHeaders map[string]string, args []string) (str
5553

5654
// Sign the hashed header with the RSA key
5755
signature, err := rsa.SignPKCS1v15(nil, rsaKey, crypto.SHA256, hash[:])
58-
5956
if err != nil {
6057
return "", fmt.Errorf("error calling SignStringRS256PKCS8; could not sign header: %w", err)
6158
}
@@ -90,7 +87,6 @@ func argsToKeyPassphrase(args []string) (string, string, error) {
9087
passphrase := args[1]
9188

9289
key, err := formatKey(args[0], passphrase != "")
93-
9490
if err != nil {
9591
return "", "", err
9692
}

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/nytimes/httptest
22

3-
go 1.24.4
3+
go 1.25.6
44

55
require (
66
github.com/drone/envsubst v1.0.3
@@ -9,16 +9,16 @@ require (
99
github.com/tidwall/gjson v1.18.0
1010
github.com/tidwall/pretty v1.2.1
1111
github.com/youmark/pkcs8 v0.0.0-20240726163527-a2c0da244d78
12-
go.uber.org/zap v1.27.0
12+
go.uber.org/zap v1.27.1
1313
gopkg.in/yaml.v2 v2.4.0
1414
)
1515

1616
require (
1717
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
1818
github.com/mattn/go-colorable v0.1.14 // indirect
1919
github.com/mattn/go-isatty v0.0.20 // indirect
20-
github.com/tidwall/match v1.1.1 // indirect
20+
github.com/tidwall/match v1.2.0 // indirect
2121
go.uber.org/multierr v1.11.0 // indirect
22-
golang.org/x/crypto v0.39.0 // indirect
23-
golang.org/x/sys v0.33.0 // indirect
22+
golang.org/x/crypto v0.47.0 // indirect
23+
golang.org/x/sys v0.40.0 // indirect
2424
)

go.sum

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs
2222
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
2323
github.com/tidwall/gjson v1.18.0 h1:FIDeeyB800efLX89e5a8Y0BNH+LOngJyGrIWxG2FKQY=
2424
github.com/tidwall/gjson v1.18.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
25-
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
2625
github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
26+
github.com/tidwall/match v1.2.0 h1:0pt8FlkOwjN2fPt4bIl4BoNxb98gGHN2ObFEDkrfZnM=
27+
github.com/tidwall/match v1.2.0/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
2728
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
2829
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
2930
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
@@ -33,13 +34,13 @@ go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
3334
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
3435
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
3536
go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y=
36-
go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8=
37-
go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
38-
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
39-
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
37+
go.uber.org/zap v1.27.1 h1:08RqriUEv8+ArZRYSTXy1LeBScaMpVSTBhCeaZYfMYc=
38+
go.uber.org/zap v1.27.1/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E=
39+
golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8=
40+
golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A=
4041
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
41-
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
42-
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
42+
golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ=
43+
golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
4344
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
4445
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
4546
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=

internal/config.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ type Config struct {
3636
func FromEnv() (*Config, error) {
3737
// Parse non-string values
3838
concurrency, err := strconv.Atoi(getEnv("TEST_CONCURRENCY", "2"))
39-
4039
if err != nil {
4140
return nil, fmt.Errorf("invalid concurrency value: %s", err)
4241
}
@@ -46,7 +45,6 @@ func FromEnv() (*Config, error) {
4645
}
4746

4847
verbosity, err := strconv.Atoi(getEnv("TEST_VERBOSITY", "0"))
49-
5048
if err != nil {
5149
return nil, fmt.Errorf("invalid verbosity value: %s", err)
5250
}
@@ -60,7 +58,6 @@ func FromEnv() (*Config, error) {
6058
enableRetries := getEnv("ENABLE_RETRIES", "false") == "true"
6159

6260
retryCount, err := strconv.Atoi(getEnv("DEFAULT_RETRY_COUNT", "2"))
63-
6461
if err != nil {
6562
return nil, fmt.Errorf("invalid default retry count value: %s", err)
6663
}

internal/coordinator.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func RunTests(tests []*Test, config *Config) bool {
6262
PrintTestResult(t, result)
6363
}
6464
}
65+
6566
mux.Unlock()
6667
}(test)
6768
}

0 commit comments

Comments
 (0)