From 91710b904714fb80c845a86942274ce00254501f Mon Sep 17 00:00:00 2001 From: codebien <2103732+codebien@users.noreply.github.com> Date: Thu, 30 Jan 2025 17:12:43 +0100 Subject: [PATCH] Fix lint errors --- internal/cmd/config.go | 6 ++++-- internal/cmd/config_test.go | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/cmd/config.go b/internal/cmd/config.go index 64a6c18795d..d0442262faa 100644 --- a/internal/cmd/config.go +++ b/internal/cmd/config.go @@ -210,7 +210,7 @@ func readEnvConfig(envMap map[string]string) (Config, error) { // TODO: accumulate all errors and differentiate between the layers? func getConsolidatedConfig(gs *state.GlobalState, cliConf Config, runnerOpts lib.Options) (conf Config, err error) { fileConf, err := readLegacyDiskConfig(gs) - if errors.Is(err, fs.ErrNotExist) { + if errors.Is(err, fs.ErrNotExist) { //nolint:gocritic fileConf, err = readDiskConfig(gs) if err != nil { return conf, errext.WithExitCodeIfNone(err, exitcodes.InvalidConfig) @@ -218,7 +218,9 @@ func getConsolidatedConfig(gs *state.GlobalState, cliConf Config, runnerOpts lib } else if err != nil { return conf, errext.WithExitCodeIfNone(err, exitcodes.InvalidConfig) } else { - gs.Logger.Warn("The configuration file has been found on the old path. Please, run again `k6 cloud login` or `k6 login` commands to migrate to the new path. If you already migrated it manually, then remove the file from the old path.\n\n") + gs.Logger.Warn("The configuration file has been found on the old path. " + + "Please, run again `k6 cloud login` or `k6 login` commands to migrate to the new path. " + + "If you already migrated it manually, then remove the file from the old path.\n\n") } envConf, err := readEnvConfig(gs.Env) diff --git a/internal/cmd/config_test.go b/internal/cmd/config_test.go index 52953ea2507..6f8f62ede91 100644 --- a/internal/cmd/config_test.go +++ b/internal/cmd/config_test.go @@ -409,11 +409,12 @@ func TestWriteDiskConfigNoJSONContentError(t *testing.T) { } func TestMigrateLegacyConfigFileIfAny(t *testing.T) { + t.Parallel() memfs := fsext.NewMemMapFs() conf := []byte(`{"iterations":1028,"cloud":{"field1":"testvalue"}}`) legacyConfigPath := ".config/loadimpact/k6/config.json" - fsext.WriteFile(memfs, legacyConfigPath, conf, 0o644) + require.NoError(t, fsext.WriteFile(memfs, legacyConfigPath, conf, 0o644)) logger := logrus.New() logger.SetOutput(io.Discard) @@ -439,6 +440,7 @@ func TestMigrateLegacyConfigFileIfAny(t *testing.T) { } func TestMigrateLegacyConfigFileIfAnyWhenFileDoesNotExist(t *testing.T) { + t.Parallel() memfs := fsext.NewMemMapFs() defaultFlags := state.GetDefaultFlags(".config")