{"id":13786679,"url":"https://github.com/muir/reflectutils","last_synced_at":"2026-01-12T12:50:19.108Z","repository":{"id":42042366,"uuid":"420598276","full_name":"muir/reflectutils","owner":"muir","description":"Golang utility functions for working with reflection","archived":false,"fork":false,"pushed_at":"2025-12-19T12:12:20.000Z","size":79,"stargazers_count":9,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-21T22:50:16.409Z","etag":null,"topics":["go","golang","reflection-library"],"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/muir.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":".github/CODEOWNERS","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":"2021-10-24T05:44:39.000Z","updated_at":"2025-12-19T03:24:12.000Z","dependencies_parsed_at":"2024-11-17T22:32:56.780Z","dependency_job_id":"236d7821-8ad0-4eda-b0bb-11cf267a9822","html_url":"https://github.com/muir/reflectutils","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/muir/reflectutils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muir%2Freflectutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muir%2Freflectutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muir%2Freflectutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muir%2Freflectutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muir","download_url":"https://codeload.github.com/muir/reflectutils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muir%2Freflectutils/sbom","scorecard":{"id":667636,"data":{"date":"2025-08-18","repo":{"name":"github.com/muir/reflectutils","commit":"4b5235c79f2aceaabf76ec70732799cb379d8c6d"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":3.9,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/16 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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/muir/reflectutils/codecov.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codecov.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/muir/reflectutils/codecov.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/muir/reflectutils/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/muir/reflectutils/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/muir/reflectutils/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/muir/reflectutils/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/muir/reflectutils/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/muir/reflectutils/go.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/muir/reflectutils/golangci-lint.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/muir/reflectutils/golangci-lint.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/golangci-lint.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/muir/reflectutils/golangci-lint.yml/main?enable=pin","Warn: downloadThenRun not pinned by hash: .github/workflows/codecov.yml:19","Info:   0 out of  10 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 downloadThenRun 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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:28","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:29","Warn: no topLevel permission defined: .github/workflows/codecov.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/golangci-lint.yml:4","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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":7,"reason":"SAST tool detected but not run on all commits","details":["Info: SAST configuration detected: CodeQL","Warn: 10 commits out of 27 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-21T18:39:58.736Z","repository_id":42042366,"created_at":"2025-08-21T18:39:58.736Z","updated_at":"2025-08-21T18:39:58.736Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["go","golang","reflection-library"],"created_at":"2024-08-03T19:01:28.119Z","updated_at":"2026-01-12T12:50:19.088Z","avatar_url":"https://github.com/muir.png","language":"Go","readme":"# reflectutils - utility functions for working with Golang's reflect package\n\n[![GoDoc](https://godoc.org/github.com/muir/reflectutils?status.png)](https://pkg.go.dev/github.com/muir/reflectutils)\n![unit tests](https://github.com/muir/reflectutils/actions/workflows/go.yml/badge.svg)\n[![report card](https://goreportcard.com/badge/github.com/muir/reflectutils)](https://goreportcard.com/report/github.com/muir/reflectutils)\n[![codecov](https://codecov.io/gh/muir/reflectutils/branch/main/graph/badge.svg)](https://codecov.io/gh/muir/reflectutils)\n\nInstall:\n\n\tgo get github.com/muir/reflectutils\n\n---\n\nReflectutils is simply a repository for functions useful for working with Golang's reflect package.\n\nHere's the highlights:\n\n## Walking structures\n\n```go\nfunc WalkStructElements(t reflect.Type, f func(reflect.StructField) bool)\n```\n\nRecursively walking a struct with reflect has a pitfalls: \n\n1. It isn't recurse with respect to embeded structs\n1. The `Index` field of `reflect.Structfield` of embedded structs is not relative to your starting point.\n\n[WalkStructElements()](https://pkg.go.dev/github.com/muir/reflectutils#WalkStructElements) walks \nembedded elements and it updates `StructField.Index` so that it is\nrelative to the root struct that was passed in.\n\n## Setting elements\n\n```go\nfunc MakeStringSetter(t reflect.Type, optArgs ...StringSetterArg) (func(target reflect.Value, value string) error, error)\n```\n\n[MakeStringSetter()](https://pkg.go.dev/github.com/muir/reflectutils#MakeStringSetter) \nreturns a function that can be used to assing to `reflect.Value` given a\nstring value.  It can handle arrays and slices (splits strings on commas).\n\n## Parsing struct tags\n\nUse [SplitTag()](https://pkg.go.dev/github.com/muir/reflectutils#SplitTag) to break a struct\ntag into it's elements and then use [Tag.Fill()](https://pkg.go.dev/github.com/muir/reflectutils#Tag.Fill)\nto parse it into a struct.\n\nFor example:\n\n```go\ntype TagInfo struct {\n\tName\tstring\t`pt:\"0\"`     // positional, first argument\n\tTrain\tbool\t`pt:\"train\"` // boolean: true: \"train\", \"train=true\"; false: \"!train\", \"train=false\"\n\tCount\tint\t`pt:\"count\"` // integer value will be parsed\n}\n\nst := reflect.StructTag(`foo:\"bar,!train,count=9\"`)\nvar tagInfo TagInfo\nerr := GetTag(st, \"foo\").Fill(\u0026tagInfo)\n\n// tagInfo.Name will be \"bar\"\n// tagInfo.Train will be false\n// tagInfo.Count will be 9\n```\n\n## Type names\n\nThe `TypeName()` function exists to disambiguate between type names that are\nversioned.  `reflect.Type.String()` will hides package versions.  This doesn't\nmatter unless you've, unfortunately, imported multiple versions of the same\npackage.  \n\n## Default filler\n\nThe `FillInDefaultValues()` function will look at for a struct tag named \"default\"\nand use that value to fill in values where no value has been set.\n\n## Development status\n\nReflectutils is used by several packages.  Backwards compatability is expected.\n\n","funding_links":[],"categories":["Reflection","Utilities","公用事业公司"],"sub_categories":["HTTP Clients","Utility/Miscellaneous","实用程序/Miscellaneous","Fail injection","HTTP客户端"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuir%2Freflectutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuir%2Freflectutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuir%2Freflectutils/lists"}