{"id":37087458,"url":"https://github.com/haritsfahreza/libra","last_synced_at":"2026-01-14T10:45:48.004Z","repository":{"id":55750555,"uuid":"158103942","full_name":"haritsfahreza/libra","owner":"haritsfahreza","description":"Compare your data with ease","archived":false,"fork":false,"pushed_at":"2023-06-11T18:42:55.000Z","size":51,"stargazers_count":36,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-17T12:11:25.535Z","etag":null,"topics":["audit-trail","auditing","deep-equal","deep-equals","difference","go","golang"],"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/haritsfahreza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-11-18T16:32:22.000Z","updated_at":"2023-06-12T10:03:34.000Z","dependencies_parsed_at":"2024-06-20T21:49:02.366Z","dependency_job_id":"94beef5f-586e-4cfa-990e-c556ae955ef3","html_url":"https://github.com/haritsfahreza/libra","commit_stats":null,"previous_names":["haritsfahreza/tampah"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/haritsfahreza/libra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haritsfahreza%2Flibra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haritsfahreza%2Flibra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haritsfahreza%2Flibra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haritsfahreza%2Flibra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haritsfahreza","download_url":"https://codeload.github.com/haritsfahreza/libra/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haritsfahreza%2Flibra/sbom","scorecard":{"id":455876,"data":{"date":"2025-08-11","repo":{"name":"github.com/haritsfahreza/libra","commit":"23dc5ee843ea21869bafd9c88fa9f1da0490c174"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","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":-1,"reason":"No tokens found","details":null,"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":-1,"reason":"no dependencies found","details":null,"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":10,"reason":"project is fuzzed","details":["Info: GoBuiltInFuzzer integration found: compare_test.go:217","Info: GoBuiltInFuzzer integration found: compare_test.go:228","Info: GoBuiltInFuzzer integration found: compare_test.go:239","Info: GoBuiltInFuzzer integration found: compare_test.go:250","Info: GoBuiltInFuzzer integration found: compare_test.go:261","Info: GoBuiltInFuzzer integration found: compare_test.go:272"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"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":"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":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":"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 11 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-19T09:38:38.856Z","repository_id":55750555,"created_at":"2025-08-19T09:38:38.856Z","updated_at":"2025-08-19T09:38:38.856Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:25:19.714Z","status":"ssl_error","status_checked_at":"2026-01-14T10:22:49.371Z","response_time":107,"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":["audit-trail","auditing","deep-equal","deep-equals","difference","go","golang"],"created_at":"2026-01-14T10:45:47.233Z","updated_at":"2026-01-14T10:45:47.999Z","avatar_url":"https://github.com/haritsfahreza.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference](https://pkg.go.dev/badge/github.com/haritsfahreza/libra.svg)](https://pkg.go.dev/github.com/haritsfahreza/libra)\n[![CircleCI](https://circleci.com/gh/haritsfahreza/libra.svg?style=shield)](https://circleci.com/gh/haritsfahreza/libra)\n[![codecov](https://codecov.io/gh/haritsfahreza/libra/branch/master/graph/badge.svg)](https://codecov.io/gh/haritsfahreza/libra)\n[![Go Report Card](https://goreportcard.com/badge/github.com/haritsfahreza/libra)](https://goreportcard.com/report/github.com/haritsfahreza/libra)\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n# libra\n\nLibra is a Go library to compare the interface (struct, maps, etc) and spot the differences between two of them.\n\n## Installing\n\n```sh\n$ go get -u github.com/haritsfahreza/libra\n```\n\n## Usage\n\n```go\n//Prepare the objects that you want to compare\noldPerson := Person{\n\tName:      \"Sudirman\",\n\tAge:       22,\n\tWeight:    float64(80),\n\tIsMarried: true,\n}\n\nnewPerson := Person{\n\tName:      \"Sudirman\",\n\tAge:       23,\n\tWeight:    float64(85),\n\tIsMarried: true,\n}\n\ndiffs, err := libra.Compare(context.Background(), oldPerson, newPerson)\nif err != nil {\n\tpanic(err)\n}\n\n//Use the diffs array with your own purpose e.g. printout\nfor i, diff := range diffs {\n\tfmt.Printf(\"#%d : ChangeType=%s Field=%s ObjectType=%s Old='%v' New='%v'\\n\", i, diff.ChangeType, diff.Field, diff.ObjectType, diff.Old, diff.New)\n}\n```\n\nPlease see [examples](https://pkg.go.dev/github.com/haritsfahreza/libra#ex-Compare--Struct) for the other usage references\n\n### Comparing struct with private fields\n\nCurrently, we need to have `String` function to get the value of the struct with private fields since `reflect` library would not be able to compare them.\n\n```go\ntype HiddenPerson struct {\n\tname string\n\tage int\n}\n\nfunc (h HiddenPerson) String() string {\n\treturn fmt.Sprintf(\"%s, %d\", h.name, h.age)\n}\n```\n\n## Contributing\n\nPlease read [CONTRIBUTING.md](https://github.com/haritsfahreza/libra/blob/master/CODE_OF_CONDUCT.md) for details on our code of conduct, and the process for submitting pull requests to us.\n\n## Versioning\n\nWe use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/haritsfahreza/libra/tags).\n\n## Authors\n\n- **Harits Fahreza Christyonotoputra** - _Initial work_ - [haritsfahreza](https://github.com/haritsfahreza)\n\nSee also the list of [contributors](https://github.com/haritsfahreza/libra/contributors) who participated in this project.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n## Acknowledgments\n\n- With `libra`, you can speed up your Go software development, especially when you build the object auditing and data versioning system.\n- This project is inspired by [`Javers`](https://javers.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharitsfahreza%2Flibra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharitsfahreza%2Flibra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharitsfahreza%2Flibra/lists"}