Skip to content

Commit

Permalink
fix \n
Browse files Browse the repository at this point in the history
  • Loading branch information
Blad3Mak3r committed Apr 25, 2023
1 parent 4e83cd9 commit 68361ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"log"
"os"
"os/exec"
"strings"
)

func GetContainerId(containerCLI string, contaierPattern string) (string, error) {
Expand All @@ -31,7 +32,7 @@ func GetContainerId(containerCLI string, contaierPattern string) (string, error)
return containerId, err
}

containerId = string(byteArray)
containerId = strings.Split(string(byteArray), "\n")[0]

if containerId == "" {
return containerId, fmt.Errorf("container pattern %s not correspond to existing container", contaierPattern)
Expand Down

0 comments on commit 68361ea

Please sign in to comment.