Skip to content

Commit 2972ed8

Browse files
test: add missing file close (#2492)
1 parent a7157fa commit 2972ed8

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

Diff for: internal/integrationtest/config/config_test.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -822,16 +822,10 @@ func TestInitializationOrderOfConfigThroughFlagAndEnv(t *testing.T) {
822822
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
823823
defer env.CleanUp()
824824

825-
createConfig := func(path *paths.Path, content string) {
826-
f, err := path.Create()
827-
require.NoError(t, err)
828-
_, err = f.WriteString(content)
829-
require.NoError(t, err)
830-
}
831825
tmp := t.TempDir()
832826
cliConfig, envConfig := paths.New(filepath.Join(tmp, "cli.yaml")), paths.New(filepath.Join(tmp, "env.yaml"))
833-
createConfig(cliConfig, `cli-test: "test"`)
834-
createConfig(envConfig, `env-test: "test"`)
827+
cliConfig.WriteFile([]byte(`cli-test: "test"`))
828+
envConfig.WriteFile([]byte(`env-test: "test"`))
835829

836830
// No flag nor env specified.
837831
stdout, _, err := cli.Run("config", "dump", "--format", "json")

0 commit comments

Comments
 (0)