cmd/cover: clarify the format of cover profile generated with go test -coverprofile #40251
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
Processing the coverage profile generated from
go test -coverprofile
to integrate it with editors,we need clarification of the output format.
The profile looks like
and the first element of each item (link) is often called FileName, but this is not the true file name.
Code here determines what this is. It is either the import path and the base file name, or the absolute path (isn't it platform dependent?)
See how
go tool cover -html=...
parses the profile output. Any editor integration work requires to implement the same to associate the coverage info with the source code.This detail is hidden deep in the source code. We need to document this.
The cover tool documentation can be the first place users would search.
cc @ianthehat @pjweinbgo @jayconrod
The text was updated successfully, but these errors were encountered: