{"id":37151174,"url":"https://github.com/gomoni/null","last_synced_at":"2026-01-14T17:52:00.076Z","repository":{"id":114450135,"uuid":"439362563","full_name":"gomoni/null","owner":"gomoni","description":"Go null and undefined aware type wrapper","archived":false,"fork":false,"pushed_at":"2022-01-03T08:29:54.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T16:52:03.975Z","etag":null,"topics":["generics","go","golang","json"],"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/gomoni.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-17T14:38:31.000Z","updated_at":"2023-04-14T16:45:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"28d6b4be-fa31-413d-b23b-efe25a8b1ca3","html_url":"https://github.com/gomoni/null","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gomoni/null","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomoni%2Fnull","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomoni%2Fnull/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomoni%2Fnull/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomoni%2Fnull/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gomoni","download_url":"https://codeload.github.com/gomoni/null/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gomoni%2Fnull/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28428963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:38:47.836Z","status":"ssl_error","status_checked_at":"2026-01-14T16:34:59.695Z","response_time":107,"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":["generics","go","golang","json"],"created_at":"2026-01-14T17:51:59.405Z","updated_at":"2026-01-14T17:52:00.070Z","avatar_url":"https://github.com/gomoni.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n\n# null\nnull is a Go library providing an easy to use interface to handle `null` value or missing key. `Type[T any]` implements `json.Marshaler` and `json.Unmarshaler` . Because of generics it works for any type which can be unmarshalled from/marshalled into JSON.\n\nMarshalling of undefined is an error though.\n\n# Usage\n\n```go\n// define struct with a wrapper type\nvar s struct {\n    Key Type[int] `json:\"key\"`\n}\n// unmarshal as usual\nerr := json.Unmarshal(data, \u0026s)\n// access value via Value() method, which returns error for null and undefined cases\nvalue, err := s.Key.Value()\n```\n\n| JSON           | Value  | Error        |\n|----------------|--------|--------------|\n|`{\"key\": 42}`   | `42`   | `nil`        |\n|`{\"key\": null}` | _zero_ | ErrNull      |\n|`{}`            | _zero_ | ErrUndefined |\n\n# Build and test\n\ninstall gotip (until go 1.18 release)\n\n```bash\ngo install golang.org/dl/gotip@latest\ngotip download\ngotip test -v\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgomoni%2Fnull","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgomoni%2Fnull","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgomoni%2Fnull/lists"}