mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/covdata: tweak output format for 'go tool covdata percent'
Include some additional whitepace when emitting percentage of statements covered per package, to make "go tool covdata percent" output more like "go test -cover" output. Change-Id: I450cf2bfa05b1eed747cb2f99967314419fa446c Reviewed-on: https://go-review.googlesource.com/c/go/+/495445 Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
a371fa5e70
commit
5cdc3874b0
2 changed files with 2 additions and 2 deletions
|
|
@ -66,7 +66,7 @@ q.go:33.0,40.0 7 2`)
|
|||
t.Fatalf("EmitPercent returned %v", err)
|
||||
}
|
||||
wantPercent := strings.TrimSpace(`
|
||||
my/pack coverage: 62.5% of statements
|
||||
my/pack coverage: 62.5% of statements
|
||||
`)
|
||||
gotPercent := strings.TrimSpace(b2.String())
|
||||
if wantPercent != gotPercent {
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ func (fm *Formatter) EmitPercent(w io.Writer, covpkgs string, noteEmpty bool) er
|
|||
coveredStmts += nx
|
||||
}
|
||||
}
|
||||
if _, err := fmt.Fprintf(w, "\t%s\t", importpath); err != nil {
|
||||
if _, err := fmt.Fprintf(w, "\t%s\t\t", importpath); err != nil {
|
||||
return err
|
||||
}
|
||||
if totalStmts == 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue