{"id":20981419,"url":"https://github.com/nobe4/gtfo","last_synced_at":"2026-06-25T02:31:48.003Z","repository":{"id":43659322,"uuid":"263407229","full_name":"nobe4/gtfo","owner":"nobe4","description":"Go Test FOrmat","archived":false,"fork":false,"pushed_at":"2022-02-25T11:55:05.000Z","size":24,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-20T06:41:41.776Z","etag":null,"topics":["golang","golang-tools","test"],"latest_commit_sha":null,"homepage":"https://github.com/nobe4/gtfo","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nobe4.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":"2020-05-12T17:37:33.000Z","updated_at":"2020-05-14T06:59:29.000Z","dependencies_parsed_at":"2022-09-04T10:11:18.432Z","dependency_job_id":null,"html_url":"https://github.com/nobe4/gtfo","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/nobe4%2Fgtfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nobe4%2Fgtfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nobe4%2Fgtfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nobe4%2Fgtfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nobe4","download_url":"https://codeload.github.com/nobe4/gtfo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243383142,"owners_count":20282091,"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":["golang","golang-tools","test"],"created_at":"2024-11-19T05:37:27.288Z","updated_at":"2026-06-25T02:31:47.987Z","avatar_url":"https://github.com/nobe4.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"GTFO\n====\n\n\u003e Go Test FOrmat\n\nThis package aims at creating a simple formatter for the test logs in golang.\n\nIn a sense, this adds a missing `-format` to the `go test` command. This is\nrequired in some cases when the editor expect some defined-output from a\ncommand in order to jump directly to the issues.\n\n# Usage\n\n`gtfo` accepts only the JSON output from `go test`, so you can call it in the\nfollowing way:\n\n```\ngo test -json ./... | gtfo\n```\n\nAll the flags for `test` should work as well, tho you might not get the\nexpected output. I recommend using `gtfo` for testing and jumping to results\ndirectly, but not for complete output.\n\n# Configuration\n\nYou can pass a string to the `-format` flag to specify how you want to format\nyour output. The syntax follows [golang's\ntemplate](https://golang.org/pkg/text/template/). Have a look at\n[formatter.go](./internal/formatter/formatter.go) for more informations.\n\n# Example\nIf we make a test in\n[`parser_test.go`](./internal/parser/parser_test.go) fail, we might get the\nfollowing output:\n\n```bash\n$ go test ./...\n?       github.com/nobe4/gtfo/cmd/gtfo  [no test files]\nok      github.com/nobe4/gtfo/internal/formatter        0.523s\nok      github.com/nobe4/gtfo/internal/module   (cached)\n--- FAIL: TestCases (14.80s)\n    parser_test.go:188: No Test\n    ...\n    parser_test.go:188: Fatal and fatal\n    parser_test.go:197:\n                Error Trace:    parser_test.go:197\n                Error:          Not equal:\n                                expected: \"8\"\n                                actual  : \"9\"\n\n                                Diff:\n                                --- Expected\n                                +++ Actual\n                                @@ -1 +1 @@\n                                -8\n                                +9\n                Test:           TestCases\nFAIL\nFAIL    github.com/nobe4/gtfo/internal/parser   15.223s\nFAIL\n```\n\n```bash\n$ go test -json ./... | gtfo\ninternal/formatter/parser_test.go:188: No Test\n...\ninternal/formatter/parser_test.go:188: Fatal and fatal\ninternal/formatter/parser_test.go:197:\n                Error Trace:    parser_test.go:197\n                Error:          Not equal:\n                                expected: \"8\"\n                                actual  : \"9\"\n\n                                Diff:\n                                --- Expected\n                                +++ Actual\n                                @@ -1 +1 @@\n                                -8\n                                +9\n                Test:           TestCases\n```\n\nWe have the full path from the root directory to the file in question, which\nallows for easier jumping to it.\n\nWith a special format:\n\n```bash\n$ go test -json ./... | gtfo -format \"{{.File}}:{{.Line}}:{{.Output}}\\n\"\nparser_test.go:188:No Test\n...\nparser_test.go:188:Fatal and fatal\nparser_test.go:197:\n                Error Trace:    parser_test.go:197\n                Error:          Not equal:\n                                expected: \"8\"\n                                actual  : \"9\"\n\n                                Diff:\n                                --- Expected\n                                +++ Actual\n                                @@ -1 +1 @@\n                                -8\n                                +9\n                Test:           TestCases\n```\n\n\n\n# Installation\n\nClone and build:\n```bash\nmake build\n```\n\nYou might want to change some environment variables, e.g.:\n```bash\nGOOS=linux make build\n```\n# Contribute\n\nIdeas and improvement in [TODO](./TODO.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnobe4%2Fgtfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnobe4%2Fgtfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnobe4%2Fgtfo/lists"}