inlint append

This commit is contained in:
Shreyas Goenka 2025-01-29 16:12:35 +01:00
parent 8da6c57b86
commit bb87563d23
No known key found for this signature in database
GPG Key ID: 92A07DF49CCB0622
1 changed files with 2 additions and 8 deletions

View File

@ -179,12 +179,6 @@ func getTests(t *testing.T) []string {
return testDirs return testDirs
} }
// In case of duplicate keys in env, the last value is applicable when spawning
// a process.
func setEnv(env []string, key, value string) []string {
return append(env, key+"="+value)
}
func runTest(t *testing.T, dir, coverDir string, repls testdiff.ReplacementsContext) { func runTest(t *testing.T, dir, coverDir string, repls testdiff.ReplacementsContext) {
config, configPath := LoadConfig(t, dir) config, configPath := LoadConfig(t, dir)
@ -220,7 +214,7 @@ func runTest(t *testing.T, dir, coverDir string, repls testdiff.ReplacementsCont
return b, nil return b, nil
}) })
} }
cmdEnv = setEnv(cmdEnv, "DATABRICKS_HOST", server.URL) cmdEnv = append(cmdEnv, "DATABRICKS_HOST="+server.URL)
} }
repls.SetPathWithParents(tmpDir, "$TMPDIR") repls.SetPathWithParents(tmpDir, "$TMPDIR")
@ -243,7 +237,7 @@ func runTest(t *testing.T, dir, coverDir string, repls testdiff.ReplacementsCont
coverDir = filepath.Join(coverDir, strings.ReplaceAll(dir, string(os.PathSeparator), "--")) coverDir = filepath.Join(coverDir, strings.ReplaceAll(dir, string(os.PathSeparator), "--"))
err := os.MkdirAll(coverDir, os.ModePerm) err := os.MkdirAll(coverDir, os.ModePerm)
require.NoError(t, err) require.NoError(t, err)
cmdEnv = setEnv(cmdEnv, "GOCOVERDIR", coverDir) cmdEnv = append(cmdEnv, "GOCOVERDIR="+coverDir)
} }
// Set environment variables for the process // Set environment variables for the process