{"id":21185265,"url":"https://github.com/stfsy/golang-assert","last_synced_at":"2025-07-10T01:30:29.686Z","repository":{"id":57501612,"uuid":"96140365","full_name":"stfsy/golang-assert","owner":"stfsy","description":"Two simple functions for soft unit test assertions in Go.","archived":false,"fork":false,"pushed_at":"2019-01-06T20:24:38.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-09-14T09:30:04.163Z","etag":null,"topics":["assertions","golang","testing"],"latest_commit_sha":null,"homepage":null,"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/stfsy.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}},"created_at":"2017-07-03T18:43:23.000Z","updated_at":"2019-01-06T20:24:40.000Z","dependencies_parsed_at":"2022-09-19T08:50:18.578Z","dependency_job_id":null,"html_url":"https://github.com/stfsy/golang-assert","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stfsy%2Fgolang-assert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stfsy%2Fgolang-assert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stfsy%2Fgolang-assert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stfsy%2Fgolang-assert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stfsy","download_url":"https://codeload.github.com/stfsy/golang-assert/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225606491,"owners_count":17495551,"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":["assertions","golang","testing"],"created_at":"2024-11-20T18:15:35.567Z","updated_at":"2024-11-20T18:15:36.075Z","avatar_url":"https://github.com/stfsy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Assert\n\n[![Build Status](https://travis-ci.org/stfsy/golang-assert.svg)](https://travis-ci.org/stfsy/golang-assert)\n\nTwo simple functions for soft unit test assertions in Go.\n\nYes, the [Go FAQ](https://golang.org/doc/faq#testing_framework) states the following:\n\u003e [..] testing frameworks tend to develop into mini-languages of their own, with conditionals and controls and printing mechanisms, but Go already has all those capabilities; why recreate them? We'd rather write tests in Go; it's one fewer language to learn and the approach keeps the tests straightforward and easy to understand.\n\nBut unit tests should be clean too, right? :)\n\nBoth Assertions are soft assertions. Failing tests will only be reported to the console via *t.Errorf()*.\n\n\n## Assert equal\n```go\nvar paul = Person{\n\tname: \"Paul\",\n\tage:  32}\n\nfunc TestEqual(t *testing.T) {\n\tassert.Equal(t, paul, paul, \"Paul equals paul\")\n}\n```\n\n## Assert not equal\n```go\nvar paul = Person{\n\tname: \"Paul\",\n\tage:  32}\n\nvar peter = Person{\n\tname: \"Peter\",\n\tage:  21}\n\nfunc TestNotEqual(t *testing.T) {\n\tassert.NotEqual(t, paul, peter, \"Paul does not equal peter\")\n```\n\n## Installation\n\n```bash\ngo get github.com/stfsy/golang-assert\n```\n\n## License\n\nThis project is distributed under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstfsy%2Fgolang-assert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstfsy%2Fgolang-assert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstfsy%2Fgolang-assert/lists"}