Example #1
0
File: result.go Project: dvln/vcs
// String implements a stringer for the *Results type so we can print out string
// representations for all results
func (r *Results) String() string {
	results := r.All()
	resultsStr := ""
	for i, result := range results {
		indentedOut := out.InsertPrefix(result.Output, "  ", out.AlwaysInsert, 0)
		if indentedOut == "" {
			indentedOut = "[No output from command]\n"
		}
		resultsStr += fmt.Sprintf("cmd %d: %s, output %d:\n%s", i+1, result.Cmd, i+1, indentedOut)
	}
	return resultsStr
}
Example #2
0
File: result.go Project: dvln/vcs
// String implements a stringer for the *Result type so we can print out string
// representations for any result
func (r *Result) String() string {
	indentedOut := out.InsertPrefix(r.Output, "  ", out.AlwaysInsert, 0)
	return fmt.Sprintf("cmd: %s, output:\n%s", r.Cmd, indentedOut)
}