in cluster/cluster.go [194:209]
func NewRemoteOutput(scope Scope, numErrors int, commands []ShellCommand) *RemoteOutput {
failedCommands := make([]*ShellCommand, numErrors)
index := 0
for i := range commands {
if commands[i].Error != nil {
failedCommands[index] = &commands[i]
index++
}
}
return &RemoteOutput{
Scope: scope,
NumErrors: numErrors,
Commands: commands,
FailedCommands: failedCommands,
}
}