{"id":45283440,"url":"https://github.com/kat-co/vala","last_synced_at":"2026-02-21T02:41:50.941Z","repository":{"id":19255612,"uuid":"22491344","full_name":"kat-co/vala","owner":"kat-co","description":"A simple, extensible, library to make argument validation in Go palatable.","archived":false,"fork":false,"pushed_at":"2017-02-10T18:41:13.000Z","size":12,"stargazers_count":116,"open_issues_count":0,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2026-02-17T17:28:44.937Z","etag":null,"topics":["arguments","go","parameters","validation"],"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/kat-co.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":"2014-08-01T01:25:46.000Z","updated_at":"2025-08-25T16:28:48.000Z","dependencies_parsed_at":"2022-08-01T04:38:01.461Z","dependency_job_id":null,"html_url":"https://github.com/kat-co/vala","commit_stats":null,"previous_names":["katco-/vala"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kat-co/vala","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kat-co%2Fvala","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kat-co%2Fvala/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kat-co%2Fvala/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kat-co%2Fvala/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kat-co","download_url":"https://codeload.github.com/kat-co/vala/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kat-co%2Fvala/sbom","scorecard":{"id":551368,"data":{"date":"2025-08-11","repo":{"name":"github.com/kat-co/vala","commit":"42e1d8b61f12b4fcadea0c062782e466924a3aaa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.3,"checks":[{"name":"Code-Review","score":2,"reason":"Found 4/16 approved changesets -- score normalized to 2","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":"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":"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":"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":"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":-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":"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":"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":"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":"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":"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":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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 6 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-20T10:58:22.842Z","repository_id":19255612,"created_at":"2025-08-20T10:58:22.842Z","updated_at":"2025-08-20T10:58:22.842Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29671821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T00:11:43.526Z","status":"online","status_checked_at":"2026-02-21T02:00:07.432Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["arguments","go","parameters","validation"],"created_at":"2026-02-21T02:41:50.249Z","updated_at":"2026-02-21T02:41:50.931Z","avatar_url":"https://github.com/kat-co.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"vala [![GoDoc](https://godoc.org/github.com/kat-co/vala?status.svg)](https://godoc.org/github.com/kat-co/vala)\n====\n\nA simple, extensible, library to make argument validation in Go palatable.\n\nInstead of this:\n\n```go\nfunc BoringValidation(a, b, c, d, e, f, g MyType) {\n  if (a == nil)\n    panic(\"a is nil\")\n  if (b == nil)\n    panic(\"b is nil\")\n  if (c == nil)\n    panic(\"c is nil\")\n  if (d == nil)\n    panic(\"d is nil\")\n  if (e == nil)\n    panic(\"e is nil\")\n  if (f == nil)\n    panic(\"f is nil\")\n  if (g == nil)\n    panic(\"g is nil\")\n}\n```\n\nDo this:\n\n```go\nfunc ClearValidation(a, b, c, d, e, f, g MyType) {\n  BeginValidation().Validate(\n    IsNotNil(a, \"a\"),\n    IsNotNil(b, \"b\"),\n    IsNotNil(c, \"c\"),\n    IsNotNil(d, \"d\"),\n    IsNotNil(e, \"e\"),\n    IsNotNil(f, \"f\"),\n    IsNotNil(g, \"g\"),\n  ).CheckAndPanic() // All values will get checked before an error is thrown!\n}\n```\n\nInstead of this:\n\n```go\nfunc BoringValidation(a, b, c, d, e, f, g MyType) error {\n  if (a == nil)\n    return fmt.Errorf(\"a is nil\")\n  if (b == nil)\n    return fmt.Errorf(\"b is nil\")\n  if (c == nil)\n    return fmt.Errorf(\"c is nil\")\n  if (d == nil)\n    return fmt.Errorf(\"d is nil\")\n  if (e == nil)\n    return fmt.Errorf(\"e is nil\")\n  if (f == nil)\n    return fmt.Errorf(\"f is nil\")\n  if (g == nil)\n    return fmt.Errorf(\"g is nil\")\n}\n```\n\nDo this:\n\n```go\nfunc ClearValidation(a, b, c, d, e, f, g MyType) (err error) {\n  defer func() { recover() }\n  BeginValidation().Validate(\n    IsNotNil(a, \"a\"),\n    IsNotNil(b, \"b\"),\n    IsNotNil(c, \"c\"),\n    IsNotNil(d, \"d\"),\n    IsNotNil(e, \"e\"),\n    IsNotNil(f, \"f\"),\n    IsNotNil(g, \"g\"),\n  ).CheckSetErrorAndPanic(\u0026err) // Return error will get set, and the function will return.\n\n  // ...\n\n  VeryExpensiveFunction(c, d)\n}\n```\n\nTier your validation:\n\n```go\nfunc ClearValidation(a, b, c MyType) (err error) {\n  err = BeginValidation().Validate(\n    IsNotNil(a, \"a\"),\n    IsNotNil(b, \"b\"),\n    IsNotNil(c, \"c\"),\n  ).CheckAndPanic().Validate( // Panic will occur here if a, b, or c are nil.\n    HasLen(a.Items, 50, \"a.Items\"),\n    GreaterThan(b.UserCount, 0, \"b.UserCount\"),\n    Equals(c.Name, \"Vala\", \"c.name\"),\n    Not(Equals(c.FriendlyName, \"Foo\", \"c.FriendlyName\")),\n  ).Check()\n\n  if err != nil {\n  \treturn err\n  }\n\n  // ...\n\n  VeryExpensiveFunction(c, d)\n}\n```\n\nExtend with your own validators for readability. Note that an error should always be returned so that the Not function can return a message if it passes. Unlike idiomatic Go, use the boolean to check for success.\n\n```go\nfunc ReportFitsRepository(report *Report, repository *Repository) Checker {\n\treturn func() (passes bool, err error) {\n\n\t\terr = fmt.Errof(\"A %s report does not belong in a %s repository.\", report.Type, repository.Type)\n\t\tpasses = (repository.Type == report.Type)\n\t\treturn passes, err\n\t}\n}\n\nfunc AuthorCanUpload(authorName string, repository *Repository) Checker {\n\treturn func() (passes bool, err error) {\n        err = fmt.Errof(\"%s does not have access to this repository.\", authorName)\n\t\tpasses = !repository.AuthorCanUpload(authorName)\n\t\treturn passes, err\n\t}\n}\n\nfunc AuthorIsCollaborator(authorName string, report *Report) Checker {\n\treturn func() (passes bool, err error) {\n\n        err = fmt.Errorf(\"The given author was not one of the collaborators for this report.\")\n\t\tfor _, collaboratorName := range report.Collaborators() {\n\t\t\tif collaboratorName == authorName {\n\t\t\t\tpasses = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n        return passes, err\n\t}\n}\n\nfunc HandleReport(authorName string, report *Report, repository *Repository) {\n\n\tBeginValidation().Validate(\n    \tAuthorIsCollaborator(authorName, report),\n\t\tAuthorCanUpload(authorName, repository),\n\t\tReportFitsRepository(report, repository),\n\t).CheckAndPanic()\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkat-co%2Fvala","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkat-co%2Fvala","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkat-co%2Fvala/lists"}