mirror of
https://github.com/docker/compose.git
synced 2026-08-04 14:47:40 +00:00
pkg/e2e: drop unused run param from getEnv
The run parameter was always passed as false at the single call site and the run==true branch was dead code. Remove it so unparam stops flagging callers added by PR #13742. Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
This commit is contained in:
parent
913b500140
commit
46b806eafb
1 changed files with 3 additions and 6 deletions
|
|
@ -73,22 +73,19 @@ func TestDependsOnMultipleProviders(t *testing.T) {
|
|||
|
||||
res := c.RunDockerComposeCmd(t, "-f", "fixtures/providers/depends-on-multiple-providers.yaml", "--project-name", projectName, "up")
|
||||
res.Assert(t, icmd.Success)
|
||||
env := getEnv(res.Combined(), false)
|
||||
env := getEnv(res.Combined())
|
||||
assert.Check(t, slices.Contains(env, "PROVIDER1_URL=https://magic.cloud/provider1"), env)
|
||||
assert.Check(t, slices.Contains(env, "PROVIDER2_URL=https://magic.cloud/provider2"), env)
|
||||
}
|
||||
|
||||
func getEnv(out string, run bool) []string {
|
||||
func getEnv(out string) []string {
|
||||
var env []string
|
||||
scanner := bufio.NewScanner(strings.NewReader(out))
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
if !run && strings.HasPrefix(line, "test-1 | ") {
|
||||
if strings.HasPrefix(line, "test-1 | ") {
|
||||
env = append(env, line[10:])
|
||||
}
|
||||
if run && strings.Contains(line, "=") && len(strings.Split(line, "=")) == 2 {
|
||||
env = append(env, line)
|
||||
}
|
||||
}
|
||||
slices.Sort(env)
|
||||
return env
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue