{"id":40870216,"url":"https://github.com/crypto-zero/structs","last_synced_at":"2026-01-22T00:39:22.447Z","repository":{"id":47528190,"uuid":"399083096","full_name":"crypto-zero/structs","owner":"crypto-zero","description":"Utilities for Go structs","archived":false,"fork":false,"pushed_at":"2021-08-25T09:01:06.000Z","size":165,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-21T02:18:27.669Z","etag":null,"topics":[],"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/crypto-zero.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":"2021-08-23T11:48:40.000Z","updated_at":"2021-10-21T10:07:26.000Z","dependencies_parsed_at":"2022-07-21T02:48:41.811Z","dependency_job_id":null,"html_url":"https://github.com/crypto-zero/structs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/crypto-zero/structs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-zero%2Fstructs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-zero%2Fstructs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-zero%2Fstructs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-zero%2Fstructs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crypto-zero","download_url":"https://codeload.github.com/crypto-zero/structs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crypto-zero%2Fstructs/sbom","scorecard":{"id":310169,"data":{"date":"2025-08-11","repo":{"name":"github.com/crypto-zero/structs","commit":"d1a3c4b076fc4db9bee60065a9bf30a7268d04c6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":"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":-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":"Code-Review","score":0,"reason":"Found 1/30 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":"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":"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":"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":"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":"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 1 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"}},{"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"}}]},"last_synced_at":"2025-08-17T23:02:54.771Z","repository_id":47528190,"created_at":"2025-08-17T23:02:54.771Z","updated_at":"2025-08-17T23:02:54.771Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28648460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2026-01-22T00:39:22.303Z","updated_at":"2026-01-22T00:39:22.429Z","avatar_url":"https://github.com/crypto-zero.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Goodbye is new beginning.\n\nThis project is from fatih/structs and thanks all contributions.\n\n# Structs [![GoDoc](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)](http://godoc.org/github.com/crypto-zero/structs) [![Build Status](http://img.shields.io/travis/crypto-zero/structs.svg?style=flat-square)](https://travis-ci.org/crypto-zero/structs) [![Coverage Status](http://img.shields.io/coveralls/crypto-zero/structs.svg?style=flat-square)](https://coveralls.io/r/crypto-zero/structs)\n\nStructs contains various utilities to work with Go (Golang) structs. It was\ninitially used by me to convert a struct into a `map[string]interface{}`. With\ntime I've added other utilities for structs.  It's basically a high level\npackage based on primitives from the reflect package. Feel free to add new\nfunctions or improve the existing code.\n\n## Install\n\n```bash\ngo get github.com/crypto-zero/structs\n```\n\n## Usage and Examples\n\nJust like the standard lib `strings`, `bytes` and co packages, `structs` has\nmany global functions to manipulate or organize your struct data. Lets define\nand declare a struct:\n\n```go\ntype Server struct {\n\tName        string `json:\"name,omitempty\"`\n\tID          int\n\tEnabled     bool\n\tusers       []string // not exported\n\thttp.Server          // embedded\n}\n\nserver := \u0026Server{\n\tName:    \"gopher\",\n\tID:      123456,\n\tEnabled: true,\n}\n```\n\n```go\n// Convert a struct to a map[string]interface{}\n// =\u003e {\"Name\":\"gopher\", \"ID\":123456, \"Enabled\":true}\nm := structs.Map(server)\n\n// Convert the values of a struct to a []interface{}\n// =\u003e [\"gopher\", 123456, true]\nv := structs.Values(server)\n\n// Convert the names of a struct to a []string\n// (see \"Names methods\" for more info about fields)\nn := structs.Names(server)\n\n// Convert the values of a struct to a []*Field\n// (see \"Field methods\" for more info about fields)\nf := structs.Fields(server)\n\n// Return the struct name =\u003e \"Server\"\nn := structs.Name(server)\n\n// Check if any field of a struct is initialized or not.\nh := structs.HasZero(server)\n\n// Check if all fields of a struct is initialized or not.\nz := structs.IsZero(server)\n\n// Check if server is a struct or a pointer to struct\ni := structs.IsStruct(server)\n```\n\n### Struct methods\n\nThe structs functions can be also used as independent methods by creating a new\n`*structs.Struct`. This is handy if you want to have more control over the\nstructs (such as retrieving a single Field).\n\n```go\n// Create a new struct type:\ns := structs.New(server)\n\nm := s.Map()              // Get a map[string]interface{}\nv := s.Values()           // Get a []interface{}\nf := s.Fields()           // Get a []*Field\nn := s.Names()            // Get a []string\nf := s.Field(name)        // Get a *Field based on the given field name\nf, ok := s.FieldOk(name)  // Get a *Field based on the given field name\nn := s.Name()             // Get the struct name\nh := s.HasZero()          // Check if any field is uninitialized\nz := s.IsZero()           // Check if all fields are uninitialized\n```\n\n### Field methods\n\nWe can easily examine a single Field for more detail. Below you can see how we\nget and interact with various field methods:\n\n\n```go\ns := structs.New(server)\n\n// Get the Field struct for the \"Name\" field\nname := s.Field(\"Name\")\n\n// Get the underlying value,  value =\u003e \"gopher\"\nvalue := name.Value().(string)\n\n// Set the field's value\nname.Set(\"another gopher\")\n\n// Get the field's kind, kind =\u003e  \"string\"\nname.Kind()\n\n// Check if the field is exported or not\nif name.IsExported() {\n\tfmt.Println(\"Name field is exported\")\n}\n\n// Check if the value is a zero value, such as \"\" for string, 0 for int\nif !name.IsZero() {\n\tfmt.Println(\"Name is initialized\")\n}\n\n// Check if the field is an anonymous (embedded) field\nif !name.IsEmbedded() {\n\tfmt.Println(\"Name is not an embedded field\")\n}\n\n// Get the Field's tag value for tag name \"json\", tag value =\u003e \"name,omitempty\"\ntagValue := name.Tag(\"json\")\n```\n\nNested structs are supported too:\n\n```go\naddrField := s.Field(\"Server\").Field(\"Addr\")\n\n// Get the value for addr\na := addrField.Value().(string)\n\n// Or get all fields\nhttpServer := s.Field(\"Server\").Fields()\n```\n\nWe can also get a slice of Fields from the Struct type to iterate over all\nfields. This is handy if you wish to examine all fields:\n\n```go\ns := structs.New(server)\n\nfor _, f := range s.Fields() {\n\tfmt.Printf(\"field name: %+v\\n\", f.Name())\n\n\tif f.IsExported() {\n\t\tfmt.Printf(\"value   : %+v\\n\", f.Value())\n\t\tfmt.Printf(\"is zero : %+v\\n\", f.IsZero())\n\t}\n}\n```\n\n## Credits\n\n * [crypto-zero](https://github.com/crypto-zero)\n\n## License\n\nThe MIT License (MIT) - see LICENSE.md for more details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrypto-zero%2Fstructs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrypto-zero%2Fstructs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrypto-zero%2Fstructs/lists"}