{"id":20214296,"url":"https://github.com/robherley/guesslang-go","last_synced_at":"2026-03-06T09:31:03.804Z","repository":{"id":153796522,"uuid":"630687935","full_name":"robherley/guesslang-go","owner":"robherley","description":"Go port of guesslang to detect programming languages with deep learning","archived":false,"fork":false,"pushed_at":"2026-01-10T18:28:18.000Z","size":16187,"stargazers_count":22,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-11T05:31:33.085Z","etag":null,"topics":["go","tensorflow"],"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/robherley.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":"2023-04-20T23:45:51.000Z","updated_at":"2026-01-10T18:28:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"b154bc32-450a-436a-8c37-0129fc10d7d8","html_url":"https://github.com/robherley/guesslang-go","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/robherley/guesslang-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robherley%2Fguesslang-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robherley%2Fguesslang-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robherley%2Fguesslang-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robherley%2Fguesslang-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robherley","download_url":"https://codeload.github.com/robherley/guesslang-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robherley%2Fguesslang-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30168966,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T07:56:45.623Z","status":"ssl_error","status_checked_at":"2026-03-06T07:55:55.621Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["go","tensorflow"],"created_at":"2024-11-14T06:15:05.966Z","updated_at":"2026-03-06T09:31:03.760Z","avatar_url":"https://github.com/robherley.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# guesslang-go 🔍\n\n[![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](https://pkg.go.dev/github.com/robherley/guesslang-go)\n[![Test](https://github.com/robherley/guesslang-go/actions/workflows/test.yml/badge.svg)](https://github.com/robherley/guesslang-go/actions/workflows/test.yml)\n\nGo port of [yoeo/guesslang](https://github.com/yoeo/guesslang). Detects programming language of source code using a deep learning model.\n\n\u003e [!NOTE]\n\u003e If you are looking for a library with similar functionality, try [robherley/magika-go](https://github.com/robherley/magika-go). It has a more accurate model (uses [Magika](https://securityresearch.google/magika/introduction/overview) from Google) and lighter runtime dependencies (ONNX instead of Tensorflow).\n\n## Setup\n\n### Dependencies\n\nRequires [`libtensorflow`](https://www.tensorflow.org/install/lang_c) C API.\n\nOn macOS, it can be installed with homebrew:\n\n```\nbrew install libtensorflow\n```\n\nAlternatively, for Linux-based systems:\n\n```\nscript/install-libtensorflow\n```\n\n### Install\n\n```\ngo get github.com/robherley/guesslang-go\n```\n\nSee example usage in [`examples/main.go`](/example/main.go)\n\n## Caveats\n\nTo work around some of the limitations of the Go TensorFlow bindings (and the wrapper library)[^1], the [SavedModel](https://www.tensorflow.org/guide/saved_model) is embeded in the binary and\nwhen a [`Guesser`](https://pkg.go.dev/github.com/robherley/guesslang-go/pkg/guesser#Guesser) is initialized, it temporarily writes the model to a directory (and removes it after).\n\nSo, in order to use this package, you must at least have a writeable temporary directory that aligns with Go's [`os.TempDir()`](https://pkg.go.dev/os@go1.20.3#TempDir).\n\n[^1]: https://github.com/galeone/tfgo/issues/44#issuecomment-841806254\n\n## Acknowledgements\n\nPowered by:\n\n- [yoeo/guesslang](https://github.com/yoeo/guesslang): language model\n- [tensorflow/tensorflow](https://github.com/tensorflow/tensorflow): TensorFlow\n- [galeone/tfgo](https://github.com/galeone/tfgo): TensorFlow in Go\n\nInspired by:\n\n- [microsoft/vscode-languagedetection](https://github.com/microsoft/vscode-languagedetection)\n- [hieplpvip/guesslang-js](https://github.com/hieplpvip/guesslang-js)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobherley%2Fguesslang-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobherley%2Fguesslang-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobherley%2Fguesslang-go/lists"}