I'm using glide to manage dependencies on my project. I created a script that runs go test $(glide novendor)
(which tests all directories, excluding the vendor/ one) for me. While it works, the output for the run command doesn't go beyond the 1st line:
ok my/project/scripts 0.005s
Here is the portion of the script that runs it:
// Get the paths to test (excluding the "vendor/" directory)
cmd := exec.Command("glide", "novendor")
var out bytes.Buffer
cmd.Stdout = &out
err = cmd.Run()
if err != nil {
log.Fatal("Could not run `glide novendor`: ", err)
}
glidenovendor := []string{"test"}
// Represents the "test ./src/... ./scripts/..." portion of the command
glidenovendor = append(glidenovendor, strings.Split(out.String(), " ")...)
// Run `go test ./src/... ./scripts/...`
cmd = exec.Command("go", glidenovendor...)
cmd.Stdout = os.Stdout
err = cmd.Run()
if err != nil {
log.Fatal("Could not run `go test` command with args: ", cmd, err)
}
Running the command directly on my shell gives me all lines of out put as expected.
How do I make my script print the entire output?