{"id":21866974,"url":"https://github.com/nitram509/golang-clean-test-code-showcase","last_synced_at":"2025-03-21T21:25:06.986Z","repository":{"id":143342998,"uuid":"315930108","full_name":"nitram509/golang-clean-test-code-showcase","owner":"nitram509","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-04T11:28:58.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-14T15:42:02.894Z","etag":null,"topics":["clean-code","clean-code-example","go","golang","hamcrest","showcase","test","testing"],"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/nitram509.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":"2020-11-25T12:17:29.000Z","updated_at":"2024-06-19T07:41:52.187Z","dependencies_parsed_at":"2023-06-09T12:00:22.683Z","dependency_job_id":null,"html_url":"https://github.com/nitram509/golang-clean-test-code-showcase","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitram509%2Fgolang-clean-test-code-showcase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitram509%2Fgolang-clean-test-code-showcase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitram509%2Fgolang-clean-test-code-showcase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nitram509%2Fgolang-clean-test-code-showcase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nitram509","download_url":"https://codeload.github.com/nitram509/golang-clean-test-code-showcase/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244870901,"owners_count":20523950,"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":["clean-code","clean-code-example","go","golang","hamcrest","showcase","test","testing"],"created_at":"2024-11-28T05:08:03.079Z","updated_at":"2025-03-21T21:25:06.963Z","avatar_url":"https://github.com/nitram509.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# golang-clean-test-code-showcase\n\nA showcase, of how unit test can be written.\nNo claim to be complete here.\n\n### Business requirement - for this demo purpose\n\nThis showcase/demo library has some acceptance criteria\n\n* as a developer I would like to extract meaningful information from a condensed firmware string literal\n* the information extraction must work on a single line string\n* the information extraction must work on multi-line strings, separated by newline (\\\\n) \n* these fields must be available in the meaningful extracted information (struct)\n   * FirmwareName,TargetName,TargetDetail,Version,ReleaseDateStr,GitHash,ReleaseTime\n\nExample firmware String: \\\n```Betaflight / SPRACINGF3EVO (SPEV) 3.4.0 Apr 17 2018 / 14:00:13 (b2c247d34) MSP API: 1.39```\n\n### Implementations\n\n1. Using native/vanilla GO language and library\n2. Using famous [stretchr/testify](https://github.com/stretchr/testify) library\n3. Using broken and outdated [rdrdr/hamcrest](https://github.com/rdrdr/hamcrest) library\n4. Using almost unknown [corbym/gocrest](https://github.com/corbym/gocrest) library\n    * fun fact https://star-history.t9t.io/#corbym/gocrest\n\n### What is / Why \"HAMCREST\"?\n\n[Hamcrest](http://hamcrest.org/) is a famous Java Library, that was developed to make\nunit tests in Java more readable and follow [Clean Code principles](https://de.wikipedia.org/wiki/Clean_Code)\n\nCite from hamcrest.org ... \\\n*Matchers that can be combined to create flexible expressions of intent* \\\n*Born in Java, Hamcrest now has implementations in a number of languages*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitram509%2Fgolang-clean-test-code-showcase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnitram509%2Fgolang-clean-test-code-showcase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnitram509%2Fgolang-clean-test-code-showcase/lists"}