Skip to content

Commit

Permalink
chore: update linter (#2387)
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez authored Jan 2, 2025
1 parent ee7a9e4 commit 5f53d3e
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
env:
GO_VERSION: stable
GOLANGCI_LINT_VERSION: v1.62.0
GOLANGCI_LINT_VERSION: v1.63.3
HUGO_VERSION: 0.131.0
CGO_ENABLED: 0
LEGO_E2E_TESTS: CI
Expand Down
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ linters-settings:
errorf: true
sprintf1: true
strconcat: false
usetesting:
os-setenv: false # we already have a test "framework" to handle env vars

run:
timeout: 10m
Expand Down
5 changes: 3 additions & 2 deletions challenge/dns01/dns_challenge_manual_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ func TestDNSProviderManual(t *testing.T) {

for _, test := range testCases {
t.Run(test.desc, func(t *testing.T) {
file, err := os.CreateTemp("", "lego_test")
file, err := os.CreateTemp(t.TempDir(), "lego_test")
require.NoError(t, err)
defer func() { _ = os.Remove(file.Name()) }()

t.Cleanup(func() { _ = file.Close() })

_, err = file.WriteString(test.input)
require.NoError(t, err)
Expand Down
10 changes: 6 additions & 4 deletions platform/config/env/env_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,10 @@ func TestGetOrFile_ReadsFiles(t *testing.T) {
err = os.Unsetenv(varEnvName)
require.NoError(t, err)

file, err := os.CreateTemp("", "lego")
file, err := os.CreateTemp(t.TempDir(), "lego")
require.NoError(t, err)
defer os.Remove(file.Name())

t.Cleanup(func() { _ = file.Close() })

err = os.WriteFile(file.Name(), []byte("lego_file\n"), 0o644)
require.NoError(t, err)
Expand All @@ -392,9 +393,10 @@ func TestGetOrFile_PrefersEnvVars(t *testing.T) {
err = os.Unsetenv(varEnvName)
require.NoError(t, err)

file, err := os.CreateTemp("", "lego")
file, err := os.CreateTemp(t.TempDir(), "lego")
require.NoError(t, err)
defer os.Remove(file.Name())

t.Cleanup(func() { _ = file.Close() })

err = os.WriteFile(file.Name(), []byte("lego_file"), 0o644)
require.NoError(t, err)
Expand Down
4 changes: 2 additions & 2 deletions providers/dns/designate/designate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ func TestNewDNSProviderConfig(t *testing.T) {
func createCloudsYaml(t *testing.T, cloudName string, cloud clientconfig.Cloud) string {
t.Helper()

file, err := os.CreateTemp("", "lego_test")
file, err := os.CreateTemp(t.TempDir(), "lego_test")
require.NoError(t, err)

t.Cleanup(func() { _ = os.RemoveAll(file.Name()) })
t.Cleanup(func() { _ = file.Close() })

clouds := clientconfig.Clouds{
Clouds: map[string]clientconfig.Cloud{
Expand Down

0 comments on commit 5f53d3e

Please sign in to comment.