func createComment(reportTemplate *template.Template, pj prowapi.ProwJob, entries []string) (string, error) {
	plural := ""
	if len(entries) > 1 {
		plural = "s"
	}
	var b bytes.Buffer
	if reportTemplate != nil {
		if err := reportTemplate.Execute(&b, &pj); err != nil {
			return "", err
		}
	}
	lines := []string{
		fmt.Sprintf("@%s: The following test%s **failed**, say `/retest` to rerun them all:", pj.Spec.Refs.Pulls[0].Author, plural),
		"",
		"Test name | Commit | Details | Rerun command",
		"--- | --- | --- | ---",
	}
	lines = append(lines, entries...)
	if reportTemplate != nil {
		lines = append(lines, "", b.String())
	}
	lines = append(lines, []string{
		"",
		"<details>",
		"",
		plugins.AboutThisBot,
		"</details>",
		commentTag,
	}...)
	return strings.Join(lines, "\n"), nil
}
func createComment(reportTemplate *template.Template, pj prowapi.ProwJob, entries []string) (string, error) {
	plural := ""
	if len(entries) > 1 {
		plural = "s"
	}
	var b bytes.Buffer
	if reportTemplate != nil {
		if err := reportTemplate.Execute(&b, &pj); err != nil {
			return "", err
		}
	}
	lines := []string{
		fmt.Sprintf("@%s: The following test%s **failed**, say `/retest` to rerun them all:", pj.Spec.Refs.Pulls[0].Author, plural),
		"",
		"Test name | Commit | Details | Rerun command",
		"--- | --- | --- | ---",
	}
	lines = append(lines, entries...)
	if reportTemplate != nil {
		lines = append(lines, "", b.String())
	}
	lines = append(lines, []string{
		"",
		"<details>",
		"",
		plugins.AboutThisBot,
		"</details>",
		commentTag,
	}...)
	return strings.Join(lines, "\n"), nil
}
func createComment ( reportTemplate * template . Template , pj prowapi . ProwJob , entries [ ] string ) ( string , error ) { plural := " " if len ( entries ) > 1 { plural = " " } var b bytes . Buffer if reportTemplate != nil { if err := reportTemplate . Execute ( & b , & pj ) ; err != nil { return " " , err } } lines := [ ] string { fmt . Sprintf ( " " , pj . Spec . Refs . Pulls [ 0 ] . Author , plural ) , " " , " " , " " , } lines = append ( lines , entries ... ) if reportTemplate != nil { lines = append ( lines , " " , b . String ( ) ) } lines = append ( lines , [ ] string { " " , " " , " " , plugins . AboutThisBot , " " , commentTag , } ... ) return strings . Join ( lines , " \n " ) , nil }
// createComment take a ProwJob and a list of entries generated with
// createEntry and returns a nicely formatted comment. It may fail if template
// execution fails.
createComment take a ProwJob and a list of entries generated with createEntry and returns a nicely formatted comment . It may fail if template execution fails .