{"id":15394396,"url":"https://github.com/xyproto/rust-go-example","last_synced_at":"2025-04-15T23:53:23.299Z","repository":{"id":185577460,"uuid":"673758463","full_name":"xyproto/rust-go-example","owner":"xyproto","description":"An example of how to combine Rust and Go in the same program","archived":false,"fork":false,"pushed_at":"2023-08-02T14:08:43.000Z","size":4,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T03:03:54.789Z","etag":null,"topics":["example","go","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xyproto.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-08-02T11:02:04.000Z","updated_at":"2024-03-24T23:01:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"15443073-4be1-460e-91a5-ce663288363c","html_url":"https://github.com/xyproto/rust-go-example","commit_stats":{"total_commits":4,"total_committers":3,"mean_commits":"1.3333333333333333","dds":0.5,"last_synced_commit":"7c1547432500db0cca7fba3ae20b06a4f08754fd"},"previous_names":["xyproto/rust-go-example"],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Frust-go-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Frust-go-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Frust-go-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Frust-go-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xyproto","download_url":"https://codeload.github.com/xyproto/rust-go-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173061,"owners_count":21224481,"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":["example","go","rust"],"created_at":"2024-10-01T15:23:28.838Z","updated_at":"2025-04-15T23:53:23.284Z","avatar_url":"https://github.com/xyproto.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rust-go-example\n\nAn example of how to combine Rust and Go in the same program.\n\nThis function:\n\n```go\nfunc Add(x, y int) int {\n    return x + y\n}\n```\n\nIs compiled into a dynamic library (using `cargo`, `build.rs` and the `go` compiler).\n\nThe `Add` function is then called from Rust (using unsafe Rust and the `libc` crate):\n\n```rust\nresult = Add(x, y);\n```\n\nAnd the answer is printed out:\n\n```rust\nprintln!(\"The answer is: {}\", result);\n```\n\nTested on Arch Linux.\n\n`cargo build` to build and `cargo run` to run is enough, setting `LD_LIBRARY_PATH` manually was not needed here.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxyproto%2Frust-go-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxyproto%2Frust-go-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxyproto%2Frust-go-example/lists"}