chore(lint): upgrade linter from v1.56.2 to v1.61.0
- Remove no longer needed exclude rules - Add new exclude rules for printf govet errors - Remove deprecated linters `execinquery` and `exportloopref` - Rename linter `goerr113` to `err113` - Rename linter `gomnd` to `mnd`
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package files
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
@@ -77,7 +78,8 @@ PresharedKey = YJ680VN+dGrdsWNjSFqZ6vvwuiNhbq502ZL3G7Q3o3g=
|
||||
t.Parallel()
|
||||
|
||||
configFile := filepath.Join(t.TempDir(), "wg.conf")
|
||||
err := os.WriteFile(configFile, []byte(testCase.fileContent), 0600)
|
||||
const permission = fs.FileMode(0600)
|
||||
err := os.WriteFile(configFile, []byte(testCase.fileContent), permission)
|
||||
require.NoError(t, err)
|
||||
|
||||
wireguard, err := ParseWireguardConf(configFile)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package secrets
|
||||
|
||||
import (
|
||||
"io/fs"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
@@ -38,7 +39,8 @@ func Test_Source_Get(t *testing.T) {
|
||||
"empty_secret_file": {
|
||||
makeSource: func(tempDir string) (source *Source, err error) {
|
||||
secretFilepath := filepath.Join(tempDir, "test_file")
|
||||
err = os.WriteFile(secretFilepath, nil, os.ModePerm)
|
||||
const permission = fs.FileMode(0600)
|
||||
err = os.WriteFile(secretFilepath, nil, permission)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -53,7 +55,8 @@ func Test_Source_Get(t *testing.T) {
|
||||
"default_secret_file": {
|
||||
makeSource: func(tempDir string) (source *Source, err error) {
|
||||
secretFilepath := filepath.Join(tempDir, "test_file")
|
||||
err = os.WriteFile(secretFilepath, []byte{'A'}, os.ModePerm)
|
||||
const permission = fs.FileMode(0600)
|
||||
err = os.WriteFile(secretFilepath, []byte{'A'}, permission)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -69,7 +72,8 @@ func Test_Source_Get(t *testing.T) {
|
||||
"env_specified_secret_file": {
|
||||
makeSource: func(tempDir string) (source *Source, err error) {
|
||||
secretFilepath := filepath.Join(tempDir, "test_file_custom")
|
||||
err = os.WriteFile(secretFilepath, []byte{'A'}, os.ModePerm)
|
||||
const permission = fs.FileMode(0600)
|
||||
err = os.WriteFile(secretFilepath, []byte{'A'}, permission)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user