gopherage/pkg/cov/util.go
func DumpProfile(profiles []*cover.Profile, writer io.Writer) error {
	if len(profiles) == 0 {
		return errors.New("can't write an empty profile")
	}
	if _, err := io.WriteString(writer, "mode: "+profiles[0].Mode+"\n"); err != nil {
		return err
	}
	for _, profile := range profiles {
		for _, block := range profile.Blocks {
			if _, err := fmt.Fprintf(writer, "%s:%d.%d,%d.%d %d %d\n", profile.FileName, block.StartLine, block.StartCol, block.EndLine, block.EndCol, block.NumStmt, block.Count); err != nil {
				return err
			}
		}
	}
	return nil
}
func DumpProfile(profiles []*cover.Profile, writer io.Writer) error {
	if len(profiles) == 0 {
		return errors.New("can't write an empty profile")
	}
	if _, err := io.WriteString(writer, "mode: "+profiles[0].Mode+"\n"); err != nil {
		return err
	}
	for _, profile := range profiles {
		for _, block := range profile.Blocks {
			if _, err := fmt.Fprintf(writer, "%s:%d.%d,%d.%d %d %d\n", profile.FileName, block.StartLine, block.StartCol, block.EndLine, block.EndCol, block.NumStmt, block.Count); err != nil {
				return err
			}
		}
	}
	return nil
}
func DumpProfile ( profiles [ ] * cover . Profile , writer io . Writer ) error { if len ( profiles ) == 0 { return errors . New ( " " ) } if _ , err := io . WriteString ( writer , " " + profiles [ 0 ] . Mode + " \n " ) ; err != nil { return err } for _ , profile := range profiles { for _ , block := range profile . Blocks { if _ , err := fmt . Fprintf ( writer , " \n " , profile . FileName , block . StartLine , block . StartCol , block . EndLine , block . EndCol , block . NumStmt , block . Count ) ; err != nil { return err } } } return nil }
// DumpProfile dumps the profiles given to writer in go coverage format.
DumpProfile dumps the profiles given to writer in go coverage format .