{"id":19420109,"url":"https://github.com/einride/can-go","last_synced_at":"2026-02-27T12:27:15.920Z","repository":{"id":38085340,"uuid":"212217712","full_name":"einride/can-go","owner":"einride","description":"Controller Area Network (CAN) SDK for Go.","archived":false,"fork":false,"pushed_at":"2025-08-22T05:52:54.000Z","size":279,"stargazers_count":217,"open_issues_count":23,"forks_count":45,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-08-22T07:31:49.540Z","etag":null,"topics":["autonomous-vehicles","can","canbus","dbc","go","golang","socketcan"],"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/einride.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-10-01T23:23:25.000Z","updated_at":"2025-08-22T05:51:00.000Z","dependencies_parsed_at":"2023-10-12T14:47:14.399Z","dependency_job_id":"166a7fec-1052-41b1-a5cf-68ed84bd9eae","html_url":"https://github.com/einride/can-go","commit_stats":{"total_commits":217,"total_committers":17,"mean_commits":"12.764705882352942","dds":0.3640552995391705,"last_synced_commit":"5a220abda6ec532027d6c99847e513f138958bf6"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/einride/can-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fcan-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fcan-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fcan-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fcan-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/einride","download_url":"https://codeload.github.com/einride/can-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fcan-go/sbom","scorecard":{"id":370065,"data":{"date":"2025-08-11","repo":{"name":"github.com/einride/can-go","commit":"7324c6c051d11cffc733041d068308001bbb8218"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.5,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Maintained","score":3,"reason":"4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/release.yml:12","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/review.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/einride/can-go/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/einride/can-go/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/einride/can-go/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/review.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/einride/can-go/review.yml/master?enable=pin","Info:   0 out of   4 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":5,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'master'","Warn: 'stale review dismissal' is disabled on branch 'master'","Warn: required approving review count is 1 on branch 'master'","Warn: codeowners review is not required on branch 'master'","Warn: 'last push approval' is disabled on branch 'master'","Warn: no status checks found to merge onto branch 'master'","Info: PRs are required in order to make changes on branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.15.0 not signed: https://api.github.com/repos/einride/can-go/releases/238241353","Warn: release artifact v0.14.0 not signed: https://api.github.com/repos/einride/can-go/releases/222668676","Warn: release artifact v0.13.0 not signed: https://api.github.com/repos/einride/can-go/releases/218182461","Warn: release artifact v0.12.2 not signed: https://api.github.com/repos/einride/can-go/releases/207888492","Warn: release artifact v0.12.1 not signed: https://api.github.com/repos/einride/can-go/releases/183408584","Warn: release artifact v0.15.0 does not have provenance: https://api.github.com/repos/einride/can-go/releases/238241353","Warn: release artifact v0.14.0 does not have provenance: https://api.github.com/repos/einride/can-go/releases/222668676","Warn: release artifact v0.13.0 does not have provenance: https://api.github.com/repos/einride/can-go/releases/218182461","Warn: release artifact v0.12.2 does not have provenance: https://api.github.com/repos/einride/can-go/releases/207888492","Warn: release artifact v0.12.1 does not have provenance: https://api.github.com/repos/einride/can-go/releases/183408584"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:9"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T12:44:32.976Z","repository_id":38085340,"created_at":"2025-08-18T12:44:32.977Z","updated_at":"2025-08-18T12:44:32.977Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29894851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T12:09:13.686Z","status":"ssl_error","status_checked_at":"2026-02-27T12:09:13.282Z","response_time":57,"last_error":"SSL_read: 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":["autonomous-vehicles","can","canbus","dbc","go","golang","socketcan"],"created_at":"2024-11-10T13:21:09.620Z","updated_at":"2026-02-27T12:27:15.876Z","avatar_url":"https://github.com/einride.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :electric_plug: go.einride.tech/can\n\n[![PkgGoDev](https://pkg.go.dev/badge/go.einride.tech/can)](https://pkg.go.dev/go.einride.tech/can)\n[![GoReportCard](https://goreportcard.com/badge/go.einride.tech/can)](https://goreportcard.com/report/go.einride.tech/can)\n[![Codecov](https://codecov.io/gh/einride/can-go/branch/master/graph/badge.svg)](https://codecov.io/gh/einride/can-go)\n\nCAN toolkit for Go programmers.\n\ncan-go makes use of the Linux SocketCAN abstraction for CAN communication. (See\nthe [SocketCAN](https://www.kernel.org/doc/Documentation/networking/can.txt)\ndocumentation for more details).\n\n## Installation\n\n```\ngo get -u go.einride.tech/can\n```\n\n## Examples\n\n### Setting up a CAN interface\n\n```go\n\nimport \"go.einride.tech/can/pkg/candevice\"\n\nfunc main() {\n\t// Error handling omitted to keep example simple\n\td, _ := candevice.New(\"can0\")\n\t_ := d.SetBitrate(250000)\n\t_ := d.SetUp()\n\tdefer d.SetDown()\n}\n```\n\n### Receiving CAN frames\n\nReceiving CAN frames from a socketcan interface.\n\n```go\nimport \"go.einride.tech/can/pkg/socketcan\"\n\nfunc main() {\n\t// Error handling omitted to keep example simple\n\tconn, _ := socketcan.DialContext(context.Background(), \"can\", \"can0\")\n\n\trecv := socketcan.NewReceiver(conn)\n\tfor recv.Receive() {\n\t\tframe := recv.Frame()\n\t\tfmt.Println(frame.String())\n\t}\n}\n```\n\n### Sending CAN frames/messages\n\nSending CAN frames to a socketcan interface.\n\n```go\nimport \"go.einride.tech/can/pkg/socketcan\"\n\nfunc main() {\n\t// Error handling omitted to keep example simple\n\n\tconn, _ := socketcan.DialContext(context.Background(), \"can\", \"can0\")\n\n\tframe := can.Frame{}\n\ttx := socketcan.NewTransmitter(conn)\n\t_ = tx.TransmitFrame(context.Background(), frame)\n}\n```\n\n### Generating Go code from a DBC file\n\nIt is possible to generate Go code from a `.dbc` file.\n\n```\n$ go run go.einride.tech/can/cmd/cantool generate \u003cdbc file root folder\u003e \u003coutput folder\u003e\n```\n\nIn order to generate Go code that makes sense, we currently perform some\nvalidations when parsing the DBC file so there may need to be some changes on\nthe DBC file to make it work\n\nAfter generating Go code we can marshal a message to a frame:\n\n```go\n// import etruckcan \"github.com/myproject/myrepo/gen\"\n\nauxMsg := etruckcan.NewAuxiliary().SetHeadLights(etruckcan.Auxiliary_HeadLights_LowBeam)\nframe := auxMsg.Frame()\n```\n\nOr unmarshal a frame to a message:\n\n```go\n// import etruckcan \"github.com/myproject/myrepo/gen\"\n\n// Error handling omitted for simplicity\n_ := recv.Receive()\nframe := recv.Frame()\n\nvar auxMsg *etruckcan.Auxiliary\n_ = auxMsg.UnmarshalFrame(frame)\n\n```\n\n## Running integration tests\n\nBuilding the tests:\n\n```shell\n$ make build-integration-tests\n```\n\nBuilt tests are placed in build/tests.\n\nThe candevice test requires access to physical HW, so run it using sudo.\nExample:\n\n```shell\n$ sudo ./build/tests/candevice.test\n\u003e PASS\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feinride%2Fcan-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feinride%2Fcan-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feinride%2Fcan-go/lists"}