{"id":13564575,"url":"https://github.com/ryboe/q","last_synced_at":"2026-03-02T19:13:14.701Z","repository":{"id":37350622,"uuid":"51268344","full_name":"ryboe/q","owner":"ryboe","description":"Quick and dirty debugging output for tired Go programmers","archived":false,"fork":false,"pushed_at":"2025-02-13T06:48:17.000Z","size":6531,"stargazers_count":1532,"open_issues_count":1,"forks_count":72,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-27T01:53:29.078Z","etag":null,"topics":["debugger","go","golang"],"latest_commit_sha":null,"homepage":"","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/ryboe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-02-07T21:57:59.000Z","updated_at":"2025-03-25T03:15:14.000Z","dependencies_parsed_at":"2023-11-23T21:30:59.337Z","dependency_job_id":"8cc91779-57da-4a81-b682-e2cdac952da6","html_url":"https://github.com/ryboe/q","commit_stats":{"total_commits":240,"total_committers":23,"mean_commits":"10.434782608695652","dds":0.5166666666666666,"last_synced_commit":"9df3992b20aaa9dbd27c53b4fbe180b267ee4851"},"previous_names":["y0ssar1an/q"],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryboe%2Fq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryboe%2Fq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryboe%2Fq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryboe%2Fq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryboe","download_url":"https://codeload.github.com/ryboe/q/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247083142,"owners_count":20880778,"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":["debugger","go","golang"],"created_at":"2024-08-01T13:01:33.147Z","updated_at":"2026-03-02T19:13:09.664Z","avatar_url":"https://github.com/ryboe.png","language":"Go","funding_links":[],"categories":["Go","Repositories","Libraries"],"sub_categories":[],"readme":"# q\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/ryboe/q)](https://goreportcard.com/report/github.com/ryboe/q)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/ryboe/q)](https://pkg.go.dev/github.com/ryboe/q)\n\nq is a better way to do print statement debugging.\n\nType `q.Q` instead of `fmt.Printf` and your variables will be printed like this:\n\n![q output examples](https://i.imgur.com/OFmm7pb.png)\n\n## Why is this better than `fmt.Printf`?\n\n* Faster to type\n* Pretty-printed vars and expressions\n* Easier to see inside structs\n* Doesn't go to noisy-ass stdout. It goes to `$TMPDIR/q`.\n* Pretty colors!\n\n## Basic Usage\n\n```go\nimport \"q\"\n...\nq.Q(a, b, c)\n```\n\nFor best results, dedicate a terminal to tailing `$TMPDIR/q` while you work.\n\n## Install\n\n```sh\ngit clone https://github.com/ryboe/q \"$(go env GOPATH)\"/src/q\n```\n\nPut these functions in your shell config. Typing `qq` or `rmqq` will then start\ntailing `$TMPDIR/q`.\n\n```sh\nqq() {\n    clear\n\n    logpath=\"$TMPDIR/q\"\n    if [[ -z \"$TMPDIR\" ]]; then\n        logpath=\"/tmp/q\"\n    fi\n\n    if [[ ! -f \"$logpath\" ]]; then\n        echo 'Q LOG' \u003e \"$logpath\"\n    fi\n\n    tail -100f -- \"$logpath\"\n}\n\nrmqq() {\n    logpath=\"$TMPDIR/q\"\n    if [[ -z \"$TMPDIR\" ]]; then\n        logpath=\"/tmp/q\"\n    fi\n    if [[ -f \"$logpath\" ]]; then\n        rm \"$logpath\"\n    fi\n    qq\n}\n```\n\nYou also can simply `tail -f $TMPDIR/q`, but it's highly recommended to use the above commands.\n\n## Editor Integration\n\n### VS Code\n\n`Preferences \u003e User Snippets \u003e Go`\n\n```json\n\"qq\": {\n    \"prefix\": \"qq\",\n    \"body\": \"q.Q($1) // DEBUG\",\n    \"description\": \"Pretty-print to $TMPDIR/q\"\n}\n```\n\n### Sublime Text\n\n`Tools \u003e Developer \u003e New Snippet`\n\n```xml\n\u003csnippet\u003e\n    \u003ccontent\u003e\u003c![CDATA[\nq.Q($1) // DEBUG\n]]\u003e\u003c/content\u003e\n    \u003ctabTrigger\u003eqq\u003c/tabTrigger\u003e\n    \u003cscope\u003esource.go\u003c/scope\u003e\n\u003c/snippet\u003e\n```\n\n### Atom\n\n`Atom \u003e Open Your Snippets`\n\n```coffee\n'.source.go':\n    'qq':\n        'prefix': 'qq'\n        'body': 'q.Q($1) // DEBUG'\n```\n\n### JetBrains GoLand\n\n`Settings \u003e Editor \u003e Live Templates`\n\nIn `Go`, add a new template with:\n\n* Abbreviation: `qq`\n* Description: `Pretty-print to $TMPDIR/q`\n* Template text: `q.Q($END$) // DEBUG`\n* Applicable in: select the `Go` scope\n\n### Emacs\n\nAdd a new snippet file to the go-mode snippets directory\n(`$HOME/.emacs.d/snippets/go-mode/qq`). This should\ncontain:\n\n```emacs\n# -*- mode: snippet -*-\n# name: qq\n# key: qq\n# --\nq.Q(${1:...}) // DEBUG\n```\n\n### Vim/NeoVim\n\nFor [SirVer/ultisnips](https://github.com/SirVer/ultisnips), use `:UltiSnipsEdit` to add the new snippet:\n\n```snippets\nsnippet qq \"qq\"\nq.Q(${1:})\n${2}\nendsnippet\n```\n\n## Haven't I seen this somewhere before?\n\nPython programmers will recognize this as a Golang port of the\n[`q` module by zestyping](https://github.com/zestyping/q).\n\nPing does a great job of explaining `q` in his awesome lightning talk from\nPyCon 2013. Watch it! It's funny :)\n\n[![ping's PyCon 2013 lightning talk](https://i.imgur.com/7KmWvtG.jpg)](https://youtu.be/OL3De8BAhME?t=25m14s)\n\n## FAQ\n\n### Why `q.Q`?\n\nIt's quick to type and unlikely to cause naming collisions.\n\n### Is `q.Q()` safe for concurrent use?\n\nYes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryboe%2Fq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryboe%2Fq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryboe%2Fq/lists"}