Trimming spaces and newlines from result of Exec

pull/13/head
Paulo Truta 2021-06-12 13:18:34 +00:00
parent b225c6bfd8
commit 35442bc156
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ func Exec(path string, command string, args []string) string {
// log.Println("Result: " + out.String()) // ... Silence ...
return strings.Trim(out.String(), " ")
return strings.Trim(out.String(), " \n")
}

View File

@ -14,7 +14,7 @@ func TestExec(t *testing.T) {
result := Exec("/", testCommand, testArguments)
if result != "Hello World" {
t.Log("Expected 'Hello World' but got ", result)
t.Log("Expected 'Hello World' but got ", "'"+result+"'")
t.Fail()
}
}