{"id":37192129,"url":"https://github.com/smgladkovskiy/structs","last_synced_at":"2026-01-14T22:17:14.680Z","repository":{"id":57492337,"uuid":"155005825","full_name":"smgladkovskiy/structs","owner":"smgladkovskiy","description":"Golang structs - nullables and with support of custom format","archived":true,"fork":false,"pushed_at":"2021-08-02T05:44:12.000Z","size":111,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-14T01:07:09.419Z","etag":null,"topics":["bullbool","go","golang","nullable-type","nullint64","nullstring","nulltime","structs"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smgladkovskiy.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":"2018-10-27T20:22:15.000Z","updated_at":"2023-01-28T07:30:06.000Z","dependencies_parsed_at":"2022-09-01T21:03:09.006Z","dependency_job_id":null,"html_url":"https://github.com/smgladkovskiy/structs","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/smgladkovskiy/structs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smgladkovskiy%2Fstructs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smgladkovskiy%2Fstructs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smgladkovskiy%2Fstructs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smgladkovskiy%2Fstructs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smgladkovskiy","download_url":"https://codeload.github.com/smgladkovskiy/structs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smgladkovskiy%2Fstructs/sbom","scorecard":{"id":833294,"data":{"date":"2025-08-11","repo":{"name":"github.com/smgladkovskiy/structs","commit":"1fecc5a619f8e3d885f8ba800465ce31a69deddf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"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":"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":"Code-Review","score":0,"reason":"Found 1/14 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":"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":"project is archived","details":["Warn: Repository is archived."],"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:2: pin your Docker image by updating golang:alpine to golang:alpine@sha256:f18a072054848d87a8077455f0ac8a25886f2397f88bfdd222d6fafbb5bba440","Info:   0 out of   1 containerImage 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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: 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 21 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-23T18:18:43.007Z","repository_id":57492337,"created_at":"2025-08-23T18:18:43.007Z","updated_at":"2025-08-23T18:18:43.007Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28436268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T21:32:52.117Z","status":"ssl_error","status_checked_at":"2026-01-14T21:32:33.442Z","response_time":107,"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":["bullbool","go","golang","nullable-type","nullint64","nullstring","nulltime","structs"],"created_at":"2026-01-14T22:17:13.810Z","updated_at":"2026-01-14T22:17:14.675Z","avatar_url":"https://github.com/smgladkovskiy.png","language":"Go","readme":"Deprecated\n----------\nThis repo was deprecated. I was young, inexperienced, and I was thinking about the wrong thing. I'm sorry. :)\n\nstructs\n-------\n\nVarious helpful golang structs package\n\n## Zeroable types\n\nDefault value is zero value.\n\n* date\n* time\n\n## Nullable types\n\nDefault value is null value.\n\n* string\n* bool\n* int64\n* float64\n* time\n* date\n\n## Usage\n\nGet package via `go get github.com/smgladkovskiy/structs` or via `dep ensure add github.com/smgladkovskiy/structs` \nif you use dep.\n\nImport package in your go file:\n\n```go\npackage main\n\nimport (\n\t\"github.com/smgladkovskiy/structs\"      // if need to set date or time format\n\t\"github.com/smgladkovskiy/structs/null\" // if nullables are used\n\t\"github.com/smgladkovskiy/structs/zero\" // if zeroables are used\n)\n```  \n\nUse in code:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\t\n\t\"github.com/smgladkovskiy/structs\"      // if need to set date or time format\n\t\"github.com/smgladkovskiy/structs/null\" // if nullables are used\n\t\"github.com/smgladkovskiy/structs/zero\" // if zeroables are used\n)\n\nfunc main() {\n\tstructs.TimeFormat = func() string {\n\t    return time.RFC1123\n\t  }\n\t\n\tcustomTime, _ := null.NewTime(time.Now())\n\t\n\tif !customTime.Valid {\n\t\tfmt.Println(\"time is null\")\n\t\treturn\n\t}\n\t\n\tfmt.Printf(\"custom time is %s\", customTime.Time)\n}\n```\n\n## Helper functions and variables\n\n### zero.NewXXX(v interface{}) *zero.XXX\n\nInitiates new zero value of XXX type, using `Scan` method with passed value.\n\n### null.NewXXX(v interface{}) *null.XXX\n\nInitiates new nullable value of XXX type, using `Scan` method with passed value.\n\n### null.NewXXXf(format string, a ...interface{}) *null.XXX\n\nInitiates new `null.String` type value for passed format string and format variables. Available for strings.\n\n### TimeFormat\n\nThere is an opportunity for `zero.Time` and `null.Time` types to set time format witch will be used with (Un)MarshallJSON methods.\n\nTo override default package format for time (`time.RFC3339`), there must be an `stucts.TimeFormat` function \noverriding in your app at the configuration or init level:\n\n\n```go\npackage main\n\nimport (\n\t\"time\"\n\t\n\t\"github.com/smgladkovskiy/structs\"\n)\n\nfunc main() {\n\tstructs.TimeFormat = func() string {\n\t\treturn time.RFC1123\n\t}\n}\n```\n\n### DateFormat\n\nFor `zero.Date` and `null.Date` types there is the same thing with format for (Un)MarshallJSON.\n\nDefault package date format (`YYYY-MM-DD`) must be overridden with `stucts.DateFormat` function:\n\n\n```go\npackage main\n\nimport (\n\t\"github.com/smgladkovskiy/structs\"\n)\n\nfunc init() {\n\tstructs.DateFormat = func() string {\n\t\treturn \"02.01.2006\"\n\t}\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmgladkovskiy%2Fstructs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmgladkovskiy%2Fstructs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmgladkovskiy%2Fstructs/lists"}