{"id":13413885,"url":"https://github.com/corbym/gocrest","last_synced_at":"2026-01-16T17:17:20.426Z","repository":{"id":50570058,"uuid":"115227858","full_name":"corbym/gocrest","owner":"corbym","description":"GoCrest - Hamcrest-like matchers for Go","archived":false,"fork":false,"pushed_at":"2025-12-10T09:33:08.000Z","size":156,"stargazers_count":106,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-10T12:45:02.527Z","etag":null,"topics":["assertthat","go","golang","hamcrest","matcher","regex-string"],"latest_commit_sha":null,"homepage":"","language":"Go","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/corbym.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-12-23T23:27:00.000Z","updated_at":"2025-12-10T09:33:13.000Z","dependencies_parsed_at":"2024-06-18T15:25:40.507Z","dependency_job_id":"2a76636a-b2f5-45da-ad6f-6615b5579e23","html_url":"https://github.com/corbym/gocrest","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/corbym/gocrest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbym%2Fgocrest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbym%2Fgocrest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbym%2Fgocrest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbym%2Fgocrest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/corbym","download_url":"https://codeload.github.com/corbym/gocrest/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/corbym%2Fgocrest/sbom","scorecard":{"id":304611,"data":{"date":"2025-08-11","repo":{"name":"github.com/corbym/gocrest","commit":"62fe99b384a6250b659ccf7c35ca85a3ad4cce0c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/21 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":"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":"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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Info: no jobLevel write permissions found"],"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":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/corbym/gocrest/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/corbym/gocrest/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/corbym/gocrest/build.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/corbym/gocrest/build.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/corbym/gocrest/build.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   1 out of   1 goCommand 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":"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":"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.md:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE.md: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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for 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":"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 12 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-17T21:43:05.487Z","repository_id":50570058,"created_at":"2025-08-17T21:43:05.487Z","updated_at":"2025-08-17T21:43:05.487Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","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":["assertthat","go","golang","hamcrest","matcher","regex-string"],"created_at":"2024-07-30T20:01:51.961Z","updated_at":"2026-01-16T17:17:20.404Z","avatar_url":"https://github.com/corbym.png","language":"Go","funding_links":[],"categories":["Testing","测试","测试相关`测试库和测试数据集生成库`","Testing Frameworks","测试相关","Template Engines"],"sub_categories":["Testing Frameworks","HTTP Clients","交流","HTTP客户端","Advanced Console UIs","查询语"],"readme":"# gocrest\n\nA hamcrest-like assertion library for Go. GoCrest matchers are composable, self-describing and\ncan be strung together in a more readable form to create flexible assertions. \n\nInspired by [Hamcrest](https://github.com/hamcrest). \n\n[![Build](https://github.com/corbym/gocrest/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/corbym/gocrest/actions/workflows/build.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/corbym/gocrest)](https://goreportcard.com/report/github.com/corbym/gocrest)\n[![GoDoc](https://godoc.org/github.com/corbym/gocrest?status.svg)](http://godoc.org/github.com/corbym/gocrest)\n[![Coverage Status](https://coveralls.io/repos/github/corbym/gocrest/badge.svg?branch=master)](https://coveralls.io/github/corbym/gocrest?branch=master)\n## Package import\n\n```\nimport (\n  \"github.com/corbym/gocrest/by\"\n  \"github.com/corbym/gocrest/then\"\n  \"github.com/corbym/gocrest/is\"\n  \"github.com/corbym/gocrest/has\"\n)\n```\n\n## Example:\n```go\nthen.AssertThat(testing, \"hi\", is.EqualTo(\"bye\").Reason(\"we are going\"))\n```\n\noutput:\n\n```\nwe are going\nExpected: value equal to \u003cbye\u003e\n     but: \u003chi\u003e\n```\n\nComposed with AllOf:\n\n```go\nthen.AssertThat(t, \"abcdef\", is.AllOf(is.StringContaining(\"abc\"), is.LessThan(\"ghi\")))\n```\n\nAsynchronous Matching (v1.0.8 onwards):\n\n```go\n//Reader\nthen.WithinFiveSeconds(t, func(eventually gocrest.TestingT) {\n\tthen.AssertThat(eventually, by.Reading(slowReader, 1024), is.EqualTo([]byte(\"abcdefghijklmnopqrstuv\")))\n})\n```\n```go\n//channels\nthen.Eventually(t, time.Second*5, time.Second, func(eventually gocrest.TestingT) {\n\tthen.AssertThat(eventually, by.Channelling(channel), is.EqualTo(3).Reason(\"should not fail\"))\n})\n```\n```go\n// multiple assertions\nthen.WithinTenSeconds(t, func(eventually gocrest.TestingT) {\n\tthen.AssertThat(eventually, by.Channelling(channel), is.EqualTo(3).Reason(\"should not fail\"))\n\tthen.AssertThat(eventually, by.Channelling(channelTwo), is.EqualTo(\"11\").Reason(\"This is unreachable\"))\n})\n```\n# v.1.1.0 - generics\n\nChanges all the matchers to use generics instead of reflection. Some still use a bit of reflection, e.g. TypeName etc.\n\n## Other major changes:\n\n* ValueContaining has been split into StringContaining, MapContaining, MapContainingValues, MapMatchingValues, ArrayContaining and ArrayMatching.\n* No longer panics with unknown types, as types will fail at compile time.\nSome idiosyncrasies with the generic types do exist, but this is language specific;\n\n* Map matchers generally need to know the type of the map key values explicitly or the compiler will complain, e.g.\n```\nthen.AssertThat(testing, map[string]bool{\"hi\": true, \"bye\": true}, has.AllKeys[string, bool](\"hi\", \"bye\"))\n```\n* `has.Length()` is likewise pernickety about types being explicit, mainly because it works on both strings and arrays. It needs to know both the type of the array and the array/string type. Confused? me too.\n* `is.LessThan()` and `is.GreaterThan()` (and by extension `is.GreaterThanOrEqualTo` and `is.LessThanOrEqualTo`) no longer work on complex types. This is because the complex types do not support the comparison operators (yet, somehow, they could be compared by reflection 🤷 )\n\nSee the matcher_test.go file for full usage.\n\n# Matchers so far..\n\n- is.EqualTo(x)\n- is.EqualToIgnoringWhitespace(string) - compares two strings without comparing their whitespace characters.\n- is.Nil() - value must be nil\n- is.StringContaining(expected) -- acts like containsAll\n- is.MapContaining(expected) -- acts like containsAll\n- is.MapContainingValues(expected) -- acts like containsAll\n- is.MapMatchingValues(expected) -- acts like containsAll\n- is.ArrayContaining(expected) -- acts like containsAll\n- is.ArrayMatching(expected) -- acts like containsAll\n- is.Not(m *Matcher) -- logical not of matcher's result\n- is.MatchForPattern(regex string) -- a string regex expression\n- has.FunctionNamed(string x) - checks if an interface has a function (method)\n- has.FieldNamed(string x) - checks if a struct has a field named x\n- is.AllOf(... *Matcher) - returns true if all matchers match\n- is.AnyOf(... *Matcher) - return true if any matcher matches\n- is.GreaterThan(expected) - checks if actual \u003e expected\n- is.LessThan(expected)\n- is.Empty() - matches if the actual is \"\", nil or len(actual)==0\n- is.LessThan(x)\n- is.LessThanOrEqualTo(x)\n- is.GreaterThan(x)\n- is.GreaterThanOrEqualTo(x)\n- has.Length(x) - matcher if given value (int or matcher) matches the len of the given\n- has.Prefix(x) - string starts with x\n- has.Suffix(x) - string ends with x\n- has.Key(x) - map has key x\n- has.AllKeys(T x, T y) (or has.AllKeys([]T{x,y})) - finds key of type T in map\n- has.EveryElement(x1...xn) - checks if actual[i] matches corresponding expectation (x[i])\n- has.StructWithValues(map[string]*gocrest.Matcher) - checks if actual[key] matches corresponding expectation (x[key])\n\nFor more comprehensive documentation see [godoc](http://godoc.org/github.com/corbym/gocrest).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorbym%2Fgocrest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorbym%2Fgocrest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorbym%2Fgocrest/lists"}