{"id":17911544,"url":"https://github.com/sanposhiho/easydebug","last_synced_at":"2025-03-23T22:33:54.760Z","repository":{"id":57543369,"uuid":"292546602","full_name":"sanposhiho/easydebug","owner":"sanposhiho","description":"Go: add debug statements after store values 📝","archived":false,"fork":false,"pushed_at":"2020-09-05T07:34:55.000Z","size":10,"stargazers_count":16,"open_issues_count":4,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T17:44:53.141Z","etag":null,"topics":["golang","tool"],"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/sanposhiho.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-09-03T11:12:15.000Z","updated_at":"2023-03-16T01:37:23.000Z","dependencies_parsed_at":"2022-08-27T19:10:30.609Z","dependency_job_id":null,"html_url":"https://github.com/sanposhiho/easydebug","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanposhiho%2Feasydebug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanposhiho%2Feasydebug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanposhiho%2Feasydebug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sanposhiho%2Feasydebug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sanposhiho","download_url":"https://codeload.github.com/sanposhiho/easydebug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245179708,"owners_count":20573526,"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","tool"],"created_at":"2024-10-28T19:39:10.869Z","updated_at":"2025-03-23T22:33:54.478Z","avatar_url":"https://github.com/sanposhiho.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# easydebug\ntool: add debug statements after statements to store values\n\n- You can add debug statements after all statements to store values.\n- You can remove all debug statements with this tool, of course.\n- You can edit debug function `dmp` to arrange debug as you like\n\n\n## Installation\n\n```\ngo get -u github.com/sanposhiho/easydebug\n```\n\n## Usage\n\n### add debug statements\n\n```\neasydebug -f target.go -mode 0\n```\n\n### remove debug statements\n\n```\neasydebug -f target.go -mode 1\n```\n\n## sample\n\n### before\n\n```\npackage main\n\nfunc test() int {\n\thoge := 1\n\n\tfuga := 3\n\n\tif hoge == 2 {\n\t\tfuga = abusoluteTwo()\n\n\t\thoge = 12\n\n\t}\n\n\treturn hoge + fuga\n}\n\nfunc abusoluteTwo() int {\n\treturn 2\n}\n```\n\n### after\n\n```\npackage main\n\nfunc test() int {\n\thoge := 1\n\tdmp(\"hoge\", hoge)\n\n\tfuga := 3\n\tdmp(\"fuga\", fuga)\n\n\tif hoge == 2 {\n\t\tfuga = abusoluteTwo()\n\t\tdmp(\"fuga\", fuga)\n\n\t\thoge = 12\n\t\tdmp(\"hoge\", hoge)\n\n\t}\n\n\treturn hoge + fuga\n}\n\nfunc abusoluteTwo() int {\n\treturn 2\n}\n\n// generated from goeasydebug\n// function for data dump\nfunc dmp(valueName string, v ...interface{}) {\n  for _, vv := range(v) {\n      // arrange debug as you like\n      fmt.Printf(\"%s: %#v\\n\",valueName, vv)\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanposhiho%2Feasydebug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsanposhiho%2Feasydebug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsanposhiho%2Feasydebug/lists"}