Skip to content

testing: report coverage per function #5985

Description

@davecheney
Feature request: 

Would it be possible to add a mode to go test -cover similar to gocov's report mode?

The goal is to report coverage on a per function basis so you can see where your
coverage is lacking. Something like this:

lucky(~/go/src/pkg/crypto/md5) % gocov test | gocov report
ok      crypto/md5      0.016s

crypto/md5/md5.go                digest.Write            100.00% (20/20)
crypto/md5/md5.go                digest.Reset            100.00% (6/6)
crypto/md5/md5.go                Sum                     100.00% (4/4)
crypto/md5/md5.go                digest.Sum              100.00% (3/3)
crypto/md5/md5.go                New                     100.00% (3/3)
crypto/md5/md5.go                init                    100.00% (1/1)
crypto/md5/md5.go                digest.Size             100.00% (1/1)
crypto/md5/md5.go                digest.checkSum         94.74% (18/19)
crypto/md5/md5.go                digest.BlockSize        0.00% (0/1)
crypto/md5/md5block_decl.go      block                   0.00% (0/0)
crypto/md5                       ----------------        96.55% (56/58)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions