{"id":38176756,"url":"https://github.com/nicheinc/nullable","last_synced_at":"2026-01-16T23:33:54.455Z","repository":{"id":37855517,"uuid":"357656275","full_name":"nicheinc/nullable","owner":"nicheinc","description":"Provides Go types that can distinguish between null and omitted when unmarshalled from JSON.","archived":false,"fork":false,"pushed_at":"2025-10-23T19:54:55.000Z","size":153,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-12-26T17:50:51.108Z","etag":null,"topics":["backend","library","utility"],"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/nicheinc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-13T18:44:51.000Z","updated_at":"2025-10-23T19:54:59.000Z","dependencies_parsed_at":"2022-09-01T15:21:47.327Z","dependency_job_id":null,"html_url":"https://github.com/nicheinc/nullable","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/nicheinc/nullable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicheinc%2Fnullable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicheinc%2Fnullable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicheinc%2Fnullable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicheinc%2Fnullable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicheinc","download_url":"https://codeload.github.com/nicheinc/nullable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicheinc%2Fnullable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28487587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T22:54:02.790Z","status":"ssl_error","status_checked_at":"2026-01-16T22:50:10.344Z","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":["backend","library","utility"],"created_at":"2026-01-16T23:33:54.223Z","updated_at":"2026-01-16T23:33:54.431Z","avatar_url":"https://github.com/nicheinc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nup\n\n[![Build Status](https://github.com/nicheinc/nullable/actions/workflows/ci.yml/badge.svg)](https://github.com/nicheinc/nullable/actions/workflows/ci.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/nicheinc/nullable)](https://goreportcard.com/report/github.com/nicheinc/nullable)\n[![Godoc](https://godoc.org/github.com/nicheinc/nullable?status.svg)](https://godoc.org/github.com/nicheinc/nullable)\n[![license](https://img.shields.io/github/license/nicheinc/nullable.svg?cacheSeconds=2592000)](LICENSE)\n\nThis package provides types representing updates to struct fields,\ndistinguishing between no-ops, removals, and modifications when marshalling\nthose updates to/from JSON.\n\nSee [godoc](https://pkg.go.dev/github.com/nicheinc/nullable/v2) for usage and\nexamples.\n\n## Motivation\n\nIt's often useful to define data updates using JSON objects, where each\nkey-value pair represents an update to a field, using a value of `null` to\nindicate deletion. If a certain key is not present, the corresponding field is\nnot modified. We want to define go structs corresponding to these updates, which\nneed to be marshalled to/from JSON.\n\nIf we were to use pointer fields with the `omitzero` JSON struct tag option for\nthese structs, then fields explicitly set to `nil` to be removed would instead\nsimply be absent from the marshalled JSON, i.e. unchanged. If we were to use\npointer fields without `omitzero`, then `nil` fields would be present and `null`\nin the JSON output, i.e. removed.\n\nThe `nup.Update` and `nup.SliceUpdate` types distinguish between no-op and\nremoval updates, allowing them to correctly and seamlessly unmarshal themselves\nfrom JSON.\n\n## Marshalling\n\nFor best results, use\n[`json.Marshal`](https://pkg.go.dev/encoding/json#Marshal)'s `omitzero` struct\ntag option on all struct fields of type `nup.Update` or `nup.SliceUpdate`. This\nwill ensure that if the field is a no-op, it's correctly omitted from the JSON\noutput. (If the `omitzero` tag is absent, the field will be marshalled as\n`null`.)\n\n## Installation\n\nThis package can be imported into a module-aware Go project as follows:\n\n`go get github.com/nicheinc/nullable/v2`\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for details on contributing to the `nup`\npackage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicheinc%2Fnullable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicheinc%2Fnullable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicheinc%2Fnullable/lists"}