{"id":25353798,"url":"https://github.com/bfoersterling/gotracer","last_synced_at":"2025-08-13T11:53:36.193Z","repository":{"id":273194182,"uuid":"918949491","full_name":"bfoersterling/gotracer","owner":"bfoersterling","description":"Static code analysis tool for Go projects.","archived":false,"fork":false,"pushed_at":"2025-06-21T15:51:41.000Z","size":1889,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-10T23:56:24.602Z","etag":null,"topics":["callgraph","calltree","go","linter","stdonly"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bfoersterling.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2025-01-19T10:07:18.000Z","updated_at":"2025-06-21T15:51:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"3331931f-13bc-4cb1-bf91-a603de7dfecc","html_url":"https://github.com/bfoersterling/gotracer","commit_stats":null,"previous_names":["bfoersterling/gotracer"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/bfoersterling/gotracer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfoersterling%2Fgotracer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfoersterling%2Fgotracer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfoersterling%2Fgotracer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfoersterling%2Fgotracer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bfoersterling","download_url":"https://codeload.github.com/bfoersterling/gotracer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bfoersterling%2Fgotracer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270235834,"owners_count":24550187,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["callgraph","calltree","go","linter","stdonly"],"created_at":"2025-02-14T19:55:45.125Z","updated_at":"2025-08-13T11:53:36.130Z","avatar_url":"https://github.com/bfoersterling.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gotracer\n\nPrints the call graph of Go projects.\\\nDoes not support calls to third party libraries.\n\nThis project was built using std only and can only be \\\nused on std only Go projects.\n\n## Installation\n\nDownload the latest release\n```\nwget https://github.com/bfoersterling/gotracer/releases/latest/download/gotracer_linux_amd64 -O /tmp/gotracer\nsudo install -v -m 755 /tmp/gotracer /usr/local/bin/.\n```\n\nOr build it:\n```\nmake\nsudo make install\n```\n\n## Usage\n\nShow graph of Go function calls in the current dir:\n```\n$ ./gotracer\nmain\n|--parse_dir_afps\n|  `--get_gofiles\n`--verbose_calltree\n   |--new_func_center\n   |  |--get_fds_from_afps\n   |  `--get_func_uses\n   |     `--get_type_info\n   |--(func_center).get_fcalls\n   |  |--get_tree_string\n   |  `--is_method\n   `--calltree\n      |--get_fcall_from_slice\n      |--(fcall).get_children\n      |  `--get_builtin_funcs\n      |--calltree-\u003ecalltree (recursive)\n      `--calltree-\u003ecalltree (recursive)\n```\n\nThe default entry point is the `main` function.\n\nTo specify another entry point.\\\nWhich is the first call that is found when traversing function calls:\n```\n$ gotracer -d . -e calltree\ncalltree\n|--get_fcall_from_slice\n|--(fcall).get_children\n|  `--get_builtin_funcs\n|--calltree-\u003ecalltree (recursive)\n`--calltree-\u003ecalltree (recursive)\n```\n\nFor methods make sure to quote the name of the function call:\n```\ngotracer -e '(cli_args).evaluate' -d test_files/makefile_parser/\n```\n\nTo list all possible entryponts:\n```\ngotracer -l\n```\n\nTo list uncalled functions:\n```\ngotracer -u\n```\n\n#### Implementation\n\nThis program exclusively uses `Go`'s standard library.\\\nThere are no external dependencies.\n\n#### Performance\n\n`gotracer` uses the type checker that is part of the Go standard library in `go/types`.\n\nThe `Check` method from the `go/types` package initially runs for all Go files.\\\nThat is the performance bottleneck.\n\nWriting a custom type checker for is currently not an option.\n\nAnother option would be to use [pointer analysis](https://en.wikipedia.org/wiki/Pointer_analysis).\nBut there is no stable implementation of this.\\\nThe [google x project](https://pkg.go.dev/golang.org/x/tools/go/pointer) is deprecated.\n\n#### Why Are Third Party Imports Not Supported?\n\nGo's type checker from std is not up to date with the go tool \\\ndue to backwards compatibility.\\\nTemporarily setting `GOMODCACHE` to `GOROOT/src` might be an option.\\\nOr creating a hidden subdir in the directory where `gotracer` parses files.\\\nBut this implementation does not provide a clean way to do it.\n\n## TODO\n\n- option to list unreachable functions (needs correct entrypoint and will not work with external libs)\n- maybe include external calls\n\n## Copyright\n\nCopyright (c) 2025 [Björn Försterling](https://github.com/bfoersterling)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfoersterling%2Fgotracer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbfoersterling%2Fgotracer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbfoersterling%2Fgotracer/lists"}