{"id":21690617,"url":"https://github.com/reiver/go-nul","last_synced_at":"2025-03-20T12:57:00.363Z","repository":{"id":196964182,"uuid":"697712779","full_name":"reiver/go-nul","owner":"reiver","description":"Package nul implements a nullable optional-type, for the Go programming language.  In other programming languages, an optional-type might be know as: a option-type, or a maybe-type.","archived":false,"fork":false,"pushed_at":"2024-08-09T03:53:36.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T13:08:08.297Z","etag":null,"topics":["maybe-type","option-type","optional-type"],"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/reiver.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":"2023-09-28T10:16:43.000Z","updated_at":"2024-08-09T03:53:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"b4ca1f43-caf4-4794-a8e1-78ba81bc3bf9","html_url":"https://github.com/reiver/go-nul","commit_stats":null,"previous_names":["reiver/go-nul"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reiver%2Fgo-nul","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reiver%2Fgo-nul/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reiver%2Fgo-nul/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reiver%2Fgo-nul/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reiver","download_url":"https://codeload.github.com/reiver/go-nul/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244618428,"owners_count":20482316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["maybe-type","option-type","optional-type"],"created_at":"2024-11-25T17:32:36.077Z","updated_at":"2025-03-20T12:57:00.341Z","avatar_url":"https://github.com/reiver.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-nul\n\nPackage **nul** implements a **nullable** **optional-type**, for the Go programming language.\n\nIn other programming languages, an **optional-type** might be known as: a **option-type**, or a **maybe-type**.\n\n## Documention\n\nOnline documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-nul\n\n[![GoDoc](https://godoc.org/github.com/reiver/go-nul?status.svg)](https://godoc.org/github.com/reiver/go-nul)\n\n## Examples\n\nHere is an example **nullable** **optional-type** that can hold a string:\n```go\nimport \"github.com/reiver/go-nul\"\n\n//\n\nvar op nul.Nullable[string] // the default value is nothing.\n\n// ...\n\nif nul.Nothing[string]() == op {\n\tfmt.Println(\"nothing\")\n}\n\n// ...\n\nop = nul.Null[string]()\n\n// ...\n\nif nul.Null[string]() == op {\n\tfmt.Println(\"null\")\n}\n\n// ...\n\nop = nul.Something(\"Hello world! 👾\")\n\n// ...\n\nswitch op {\ncase op.Nothing[string]():\n\t//@TODO\ncase op.Null[string]():\n\t//@TODO\ncase op.Something(\"apple\"):\n\t//@TODO\ncase op.Something(\"banana\"):\n\t//@TODO\ncase op.Something(\"cherry\"):\n\t//@TODO\ndefault:\n\t//@TODO\n}\n\n// ...\n\nvalue, found := op.Get()\nif found {\n\tfmt.Println(\"VALUE:\", value)\n} else {\n\tfmt.Println(\"either nothing or null\")\n}\n```\n## Import\n\nTo import package **nul** use `import` code like the follownig:\n```\nimport \"github.com/reiver/go-nul\"\n```\n\n## Installation\n\nTo install package **nul** do the following:\n```\nGOPROXY=direct go get https://github.com/reiver/go-nul\n```\n\n## Author\n\nPackage **nul** was written by [Charles Iliya Krempeaux](http://reiver.link)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freiver%2Fgo-nul","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freiver%2Fgo-nul","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freiver%2Fgo-nul/lists"}