{"id":19800391,"url":"https://github.com/fhs/golinecov","last_synced_at":"2025-07-07T03:02:43.012Z","repository":{"id":57506832,"uuid":"206696242","full_name":"fhs/golinecov","owner":"fhs","description":"A program for analyzing the coverage profiles generated by 'go test'","archived":false,"fork":false,"pushed_at":"2019-09-06T02:33:03.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-11T05:45:14.227Z","etag":null,"topics":["command-line-tool","coverage","go","golang"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fhs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-06T02:26:46.000Z","updated_at":"2019-09-06T02:34:56.000Z","dependencies_parsed_at":"2022-08-29T20:01:21.325Z","dependency_job_id":null,"html_url":"https://github.com/fhs/golinecov","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhs%2Fgolinecov","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhs%2Fgolinecov/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhs%2Fgolinecov/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fhs%2Fgolinecov/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fhs","download_url":"https://codeload.github.com/fhs/golinecov/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241144801,"owners_count":19917357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","coverage","go","golang"],"created_at":"2024-11-12T07:39:01.827Z","updated_at":"2025-02-28T11:41:58.468Z","avatar_url":"https://github.com/fhs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GoDoc](https://godoc.org/github.com/fhs/golinecov?status.svg)](https://godoc.org/github.com/fhs/golinecov)\n[![Go Report Card](https://goreportcard.com/badge/github.com/fhs/golinecov)](https://goreportcard.com/report/github.com/fhs/golinecov)\n\n## golinecov\n\nGolinecov is a tool for analyzing the coverage profiles generated by\n`go test -coverprofile=go.cover`. It can output source code annotated\nwith coverage per-line in plain-text format, which is an alternative\nto generating HTML with [`go tool cover -html`](https://golang.org/cmd/cover/) and opening it in a web brower.\n\n## Installation\n\n\tgo get github.com/fhs/golinecov\n\n## Example Usage\n\nGenerate the coverage profile and call it `go.cover` because `golinecov`\nlooks for a profile with that name by default:\n```\n$ cd $GOROOT/go/src/strings\n$ go test -covermode=atomic -coverprofile=go.cover\n```\n\nDisplay source of `Builder.Grow` annotated with coverage per-line:\n```\n$ golinecov -src -func '^Builder\\.Grow$'\n10883 func (b *Builder) Grow(n int) {\n10883 \tb.copyCheck()\n    0 \tif n \u003c 0 {\n    0 \t\tpanic(\"strings.Builder.Grow: negative count\")\n    - \t}\n10778 \tif cap(b.buf)-len(b.buf) \u003c n {\n10778 \t\tb.grow(n)\n10778 \t}\n    - }\n```\n\nDisplay file `strings/builder.go`, annotated with coverage per-line:\n\n```\n$ golinecov -src strings/builder.go\n...\n 97.4% strings/builder.go\n```\n\nDisplay summary of coverage for all files in the profile:\n```\n$ golinecov\n 97.4% strings/builder.go\n100.0% strings/compare.go\n 95.8% strings/reader.go\n 96.8% strings/replace.go\n100.0% strings/search.go\n 99.0% strings/strings.go\n```\n\nDisplay summary of coverage for functions matching a regular expression:\n```\n$ golinecov -func '^Builder\\.'\nstrings/builder.go:32:\tBuilder.copyCheck\t100.0%\nstrings/builder.go:46:\tBuilder.String\t\t100.0%\nstrings/builder.go:51:\tBuilder.Len\t\t100.0%\nstrings/builder.go:56:\tBuilder.Cap\t\t100.0%\nstrings/builder.go:59:\tBuilder.Reset\t\t100.0%\nstrings/builder.go:66:\tBuilder.grow\t\t100.0%\nstrings/builder.go:75:\tBuilder.Grow\t\t80.0%\nstrings/builder.go:87:\tBuilder.Write\t\t100.0%\nstrings/builder.go:95:\tBuilder.WriteByte\t100.0%\nstrings/builder.go:103:\tBuilder.WriteRune\t100.0%\nstrings/builder.go:120:\tBuilder.WriteString\t100.0%\ntotal:\t\t\t(statements)\t\t97.2%\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffhs%2Fgolinecov","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffhs%2Fgolinecov","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffhs%2Fgolinecov/lists"}