prow/pod-utils/clone/format.go
func FormatRecord(record Record) string {
	output := bytes.Buffer{}
	if record.Failed {
		fmt.Fprintln(&output, "# FAILED!")
	}
	fmt.Fprintf(&output, "# Cloning %s/%s at %s", record.Refs.Org, record.Refs.Repo, record.Refs.BaseRef)
	if record.Refs.BaseSHA != "" {
		fmt.Fprintf(&output, "(%s)", record.Refs.BaseSHA)
	}
	output.WriteString("\n")
	if len(record.Refs.Pulls) > 0 {
		output.WriteString("# Checking out pulls:\n")
		for _, pull := range record.Refs.Pulls {
			fmt.Fprintf(&output, "#\t%d", pull.Number)
			if pull.SHA != "" {
				fmt.Fprintf(&output, "(%s)", pull.SHA)
			}
			fmt.Fprint(&output, "\n")
		}
	}
	for _, command := range record.Commands {
		fmt.Fprintf(&output, "$ %s\n", command.Command)
		fmt.Fprint(&output, command.Output)
		if command.Error != "" {
			fmt.Fprintf(&output, "# Error: %s\n", command.Error)
		}
	}

	return output.String()
}
func FormatRecord(record Record) string {
	output := bytes.Buffer{}
	if record.Failed {
		fmt.Fprintln(&output, "# FAILED!")
	}
	fmt.Fprintf(&output, "# Cloning %s/%s at %s", record.Refs.Org, record.Refs.Repo, record.Refs.BaseRef)
	if record.Refs.BaseSHA != "" {
		fmt.Fprintf(&output, "(%s)", record.Refs.BaseSHA)
	}
	output.WriteString("\n")
	if len(record.Refs.Pulls) > 0 {
		output.WriteString("# Checking out pulls:\n")
		for _, pull := range record.Refs.Pulls {
			fmt.Fprintf(&output, "#\t%d", pull.Number)
			if pull.SHA != "" {
				fmt.Fprintf(&output, "(%s)", pull.SHA)
			}
			fmt.Fprint(&output, "\n")
		}
	}
	for _, command := range record.Commands {
		fmt.Fprintf(&output, "$ %s\n", command.Command)
		fmt.Fprint(&output, command.Output)
		if command.Error != "" {
			fmt.Fprintf(&output, "# Error: %s\n", command.Error)
		}
	}

	return output.String()
}
func FormatRecord ( record Record ) string { output := bytes . Buffer { } if record . Failed { fmt . Fprintln ( & output , " " ) } fmt . Fprintf ( & output , " " , record . Refs . Org , record . Refs . Repo , record . Refs . BaseRef ) if record . Refs . BaseSHA != " " { fmt . Fprintf ( & output , " " , record . Refs . BaseSHA ) } output . WriteString ( " \n " ) if len ( record . Refs . Pulls ) > 0 { output . WriteString ( " \n " ) for _ , pull := range record . Refs . Pulls { fmt . Fprintf ( & output , " \t " , pull . Number ) if pull . SHA != " " { fmt . Fprintf ( & output , " " , pull . SHA ) } fmt . Fprint ( & output , " \n " ) } } for _ , command := range record . Commands { fmt . Fprintf ( & output , " \n " , command . Command ) fmt . Fprint ( & output , command . Output ) if command . Error != " " { fmt . Fprintf ( & output , " \n " , command . Error ) } } return output . String ( ) }
// FormatRecord describes the record in a human-readable
// manner for inclusion into build logs
FormatRecord describes the record in a human - readable manner for inclusion into build logs