{"id":16614696,"url":"https://github.com/cuonglm/gocmt","last_synced_at":"2025-04-10T01:16:00.640Z","repository":{"id":11561337,"uuid":"70028409","full_name":"cuonglm/gocmt","owner":"cuonglm","description":"Add missing comment on exported function, method, type, constant, variable in go file","archived":false,"fork":false,"pushed_at":"2023-08-30T15:47:02.000Z","size":35,"stargazers_count":175,"open_issues_count":2,"forks_count":28,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T01:15:52.936Z","etag":null,"topics":["comment","go","golang","golang-library","golang-tools","lint"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cuonglm.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-05T03:53:56.000Z","updated_at":"2025-03-28T09:56:34.000Z","dependencies_parsed_at":"2024-06-18T18:31:26.752Z","dependency_job_id":"0ea14739-d583-4918-81bd-c3c85d7cbacc","html_url":"https://github.com/cuonglm/gocmt","commit_stats":null,"previous_names":["gnouc/gocmt"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuonglm%2Fgocmt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuonglm%2Fgocmt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuonglm%2Fgocmt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuonglm%2Fgocmt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuonglm","download_url":"https://codeload.github.com/cuonglm/gocmt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137891,"owners_count":21053775,"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":["comment","go","golang","golang-library","golang-tools","lint"],"created_at":"2024-10-12T02:07:22.559Z","updated_at":"2025-04-10T01:16:00.616Z","avatar_url":"https://github.com/cuonglm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gocmt - Add missing comment on exported function, method, type, constant, variable in go file\n\n![Build status](https://github.com/cuonglm/gocmt/actions/workflows/ci.yml/badge.svg?branch=main)\n[![Go Reference](https://pkg.go.dev/badge/github.com/cuonglm/gocmt.svg)](https://pkg.go.dev/github.com/cuonglm/gocmt)\n[![Go Report Card](https://goreportcard.com/badge/github.com/cuonglm/gocmt)](https://goreportcard.com/report/github.com/cuonglm/gocmt)\n\n# Installation\n\nFor go1.15 and below:\n\n```sh\ngo get -u github.com/cuonglm/gocmt\n```\n\nFor go1.16 and above:\n\n```sh\ngo install github.com/cuonglm/gocmt@latest\n```\n\n# Why gocmt\n\nSome of my projects have many files with exported fields, variables, functions missing comment, so lint tools will complain.\n\nI find a way to auto add missing comment to them, just to pass the lint tools but nothing existed.\n\nSo `gocmt` comes in.\n\n# Usage\n```sh\n$ gocmt -h\nusage: gocmt [flags] [file ...]\n  -d string\n    \tDirectory to process\n  -i\tMake in-place editing\n  -t string\n    \tComment template (default \"...\")\n```\n\n# Example\n```sh\n$ cat testdata/main.go\npackage p\n\nvar i = 0\n\nvar I = 1\n\nvar c = \"constant un-exported\"\n\nconst C = \"constant exported\"\n\ntype t struct{}\n\ntype T struct{}\n\nfunc main() {\n}\n\nfunc unexport(s string) {\n}\nfunc Export(s string) {\n}\n\nfunc ExportWithComment(s string) {\n}\n```\n\nUsing `gocmt` give you:\n```sh\n$ gocmt testdata/main.go\npackage p\n\nvar i = 0\n\n// I ...\nvar I = 1\n\nvar c = \"constant un-exported\"\n\n// C ...\nconst C = \"constant exported\"\n\ntype t struct{}\n\n// T ...\ntype T struct{}\n\nfunc main() {\n}\n\nfunc unexport(s string) {\n}\n// Export ...\nfunc Export(s string) {\n}\n\n// ExportWithComment ...\nfunc ExportWithComment(s string) {\n}\n```\n\nDefault template is `...`, you can change it using `-t` option.\n\n# Author\n\nCuong Manh Le \u003ccuong.manhle.vn@gmail.com\u003e\n\n# License\n\nSee [LICENSE](https://github.com/cuonglm/gocmt/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuonglm%2Fgocmt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuonglm%2Fgocmt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuonglm%2Fgocmt/lists"}