func CreateBadge(w io.Writer, build *cbpb.Build) error {
	right, ok := badgeStatuses[build.Status]
	if !ok {
		return fmt.Errorf("no badge info defined for status %q", build.Status)
	}
	left := badgeLeft
	left.Width = 90 /* from badgeTemplate */ - right.Width

	tmpl, err := ttemplate.New("").Parse(strings.TrimSpace(badgeTemplate))
	if err != nil {
		return err
	}
	return tmpl.Execute(w, struct {
		Left, Right badgeInfo
		Date        string
	}{
		Left:  left,
		Right: right,
		Date:  build.StartTime.AsTime().UTC().Format(badgeTimeLayout),
	})
}
// CreateBadge creates an SVG badge image for build and writes it to w.
CreateBadge creates an SVG badge image for build and writes it to w.
// CreateBadge creates an SVG badge image for build and writes it to w .
func CreateBadge(w io.Writer, build *cbpb.Build) error {
	right, ok := badgeStatuses[build.Status]
	if !ok {
		return fmt.Errorf("no badge info defined for status %q", build.Status)
	}
	left := badgeLeft
	left.Width = 90  - right.Width
	tmpl, err := ttemplate.New("").Parse(strings.TrimSpace(badgeTemplate))
	if err != nil {
		return err
	}
	return tmpl.Execute(w, struct {
		Left, Right badgeInfo
		Date        string
	}{
		Left:  left,
		Right: right,
		Date:  build.StartTime.AsTime().UTC().Format(badgeTimeLayout),
	})
}
func CreateBadge ( w io . Writer , build * cbpb . Build ) error { right , ok := badgeStatuses [ build . Status ] if ! ok { return fmt . Errorf ( " " , build . Status ) } left := badgeLeft left . Width = 90 - right . Width tmpl , err := ttemplate . New ( " " ) . Parse ( strings . TrimSpace ( badgeTemplate ) ) if err != nil { return err } return tmpl . Execute ( w , struct { Left , Right badgeInfo Date string } { Left : left , Right : right , Date : build . StartTime . AsTime ( ) . UTC ( ) . Format ( badgeTimeLayout ) , } ) }
CreateBadge creates an SVG badge image for build and writes it to w.
CreateBadge creates an SVG badge image for build and writes it to w .
/* from badgeTemplate */