{"id":20709623,"url":"https://github.com/go-andiamo/gopt","last_synced_at":"2025-08-22T15:04:22.485Z","repository":{"id":63228215,"uuid":"562616804","full_name":"go-andiamo/gopt","owner":"go-andiamo","description":"Golang implementation of optionals","archived":false,"fork":false,"pushed_at":"2023-10-18T16:31:01.000Z","size":35,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T15:12:08.749Z","etag":null,"topics":["generics","go","golang","optional","optionals"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-andiamo.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,"zenodo":null}},"created_at":"2022-11-06T21:54:29.000Z","updated_at":"2023-10-18T18:06:50.000Z","dependencies_parsed_at":"2025-05-27T04:07:52.983Z","dependency_job_id":"21289ee4-eec3-4c1b-b5f4-a92628aa2b69","html_url":"https://github.com/go-andiamo/gopt","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/go-andiamo/gopt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-andiamo%2Fgopt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-andiamo%2Fgopt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-andiamo%2Fgopt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-andiamo%2Fgopt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-andiamo","download_url":"https://codeload.github.com/go-andiamo/gopt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-andiamo%2Fgopt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271657478,"owners_count":24797934,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","optional","optionals"],"created_at":"2024-11-17T02:07:19.592Z","updated_at":"2025-08-22T15:04:22.463Z","avatar_url":"https://github.com/go-andiamo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gopt\n[![GoDoc](https://godoc.org/github.com/go-andiamo/gopt?status.svg)](https://pkg.go.dev/github.com/go-andiamo/gopt)\n[![Latest Version](https://img.shields.io/github/v/tag/go-andiamo/gopt.svg?sort=semver\u0026style=flat\u0026label=version\u0026color=blue)](https://github.com/go-andiamo/gopt/releases)\n[![codecov](https://codecov.io/gh/go-andiamo/gopt/branch/main/graph/badge.svg?token=igjnZdgh0e)](https://codecov.io/gh/go-andiamo/gopt)\n[![Go Report Card](https://goreportcard.com/badge/github.com/go-andiamo/gopt)](https://goreportcard.com/report/github.com/go-andiamo/gopt)\n\nA very light Optional implementation in Golang\n\n## Installation\nTo install Gopt, use go get:\n\n    go get github.com/go-andiamo/gopt\n\nTo update Gopt to the latest version, run:\n\n    go get -u github.com/go-andiamo/gopt\n\n## Examples\n```go\npackage main\n\nimport (\n    . \"github.com/go-andiamo/gopt\"\n)\n\nfunc main() {\n    optFlt := Of[float64](1.23)\n    println(optFlt.IsPresent())\n    println(optFlt.OrElse(-1))\n\n    opt2 := Empty[float64]()\n    println(opt2.IsPresent())\n    println(opt2.OrElse(-1))\n\n    opt2.OrElseSet(10)\n    println(opt2.IsPresent())\n    println(opt2.OrElse(-1))\n}\n```\n[try on go-playground](https://go.dev/play/p/U0dKTrGlG-e)\n\nOptionals can also be very useful when used in conjunction with JSON unmarshalling - to determine whether unmarshalled properties were actually present, with a valid value, in the JSON.  The following code demonstrates...\n```go\npackage main\n\nimport (\n    \"encoding/json\"\n    \"fmt\"\n\n    . \"github.com/go-andiamo/gopt\"\n)\n\ntype NormalStruct struct {\n    Foo string\n    Bar int\n    Baz float64\n}\n\ntype OptsStruct struct {\n    Foo Optional[string]\n    Bar Optional[int]\n    Baz Optional[float64]\n}\n\nfunc main() {\n    jdata := `{\"Foo\": null, \"Bar\": 1}`\n\n    normal := \u0026NormalStruct{}\n    err := json.Unmarshal([]byte(jdata), normal)\n    if err == nil {\n        // was property Foo set???\n        fmt.Printf(\"'Foo' was set to \\\"%s\\\"???\\n\", normal.Foo) // was it really?\n        // was property Bar actually set to 0???\n        fmt.Printf(\"'Bar' was set to \\\"%d\\\"???\\n\", normal.Bar) // was it really?\n        // was property Baz actually set to 0.000???\n        fmt.Printf(\"'Baz' was set to \\\"%f\\\"???\\n\", normal.Baz) // was it really?\n    } else {\n        println(err.Error())\n    }\n\n    println()\n    // now try with optionals...\n    opts := \u0026OptsStruct{}\n    err = json.Unmarshal([]byte(jdata), opts)\n    if err == nil {\n        opts.Foo.IfSetOtherwise(\n            func(v string) {\n                fmt.Printf(\"'Foo' was set to \\\"%s\\\"\\n\", v)\n            },\n            func() {\n                println(\"'Foo' was set but not to a valid value\")\n            },\n            func() {\n                println(\"'Foo' was not set at all\")\n            },\n        )\n        opts.Bar.IfSetOtherwise(\n            func(v int) {\n                fmt.Printf(\"'Bar' was set to %d\\n\", v)\n            },\n            func() {\n                println(\"'Bar' was set but not to a valid value\")\n            },\n            func() {\n                println(\"'Bar' was not set at all\")\n            },\n        )\n        opts.Baz.IfSetOtherwise(\n            func(v float64) {\n                fmt.Printf(\"'Baz' was set to %f\\n\", v)\n            },\n            func() {\n                println(\"'Baz' was set but not to a valid value\")\n            },\n            func() {\n                println(\"'Baz' was not set at all\")\n            },\n        )\n    } else {\n        println(err.Error())\n    }\n}\n```\n[try on go-playground](https://go.dev/play/p/63eC1AJ3Qgn)\n\n## Methods\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eMethod and description\u003c/th\u003e\n        \u003cth\u003eReturns\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eAsEmpty()\u003c/code\u003e\u003cbr\u003e\n            returns a new empty optional of the same type\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e*Optional[T]\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eClear()\u003c/code\u003e\u003cbr\u003e\n            clears the optional\u003cbr\u003e\n            Clearing sets the present to false, the set flag to false and the value to an empty value\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e*Optional[T]\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eDefault(v T)\u003c/code\u003e\u003cbr\u003e\n            returns the value if present, otherwise returns the provided default value\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eT\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eFilter(f func(v T) bool)\u003c/code\u003e\u003cbr\u003e\n            if the value is present and calling the supplied filter function returns true, returns a new optional describing the value\u003cbr\u003e\n            Otherwise returns an empty optional\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e*Optional[T]\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eGet()\u003c/code\u003e\u003cbr\u003e\n            returns the value and an error if the value is not present\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e(T, error)\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eGetOk()\u003c/code\u003e\u003cbr\u003e\n            returns the value and true if the value is present\u003cbr\u003e\n            otherwise returns an empty value and false\u003cbr\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e(T, bool)\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eIfElse(condition bool, other T)\u003c/code\u003e\u003cbr\u003e\n            if the supplied condition is true and the value is present, returns the value\u003cbr\u003e\n            otherwise the other value is returned\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eT\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eIfPresent(f func(v T))\u003c/code\u003e\u003cbr\u003e\n            if the value is present, calls the supplied function with the value, otherwise does nothing\u003cbr\u003e\n            \u003cem\u003ereturns the original optional\u003c/em\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e*Optional[T]\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eIfPresentOtherwise(f func(v T), other func())\u003c/code\u003e\u003cbr\u003e\n            if the value is present, calls the supplied function with the value, otherwise calls the other function\u003cbr\u003e\n            \u003cem\u003ereturns the original optional\u003c/em\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e\u003ccode\u003e*Optional[T]\u003c/code\u003e\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eIfSet(f func(v T), notPresent func())\u003c/code\u003e\u003cbr\u003e\n            if the value was set and is present, calls the supplied function with the value\u003cbr\u003e\n            if the value was set but is not present, calls the supplied notPresent function\u003cbr\u003e\n            otherwise, does nothing\u003cbr\u003e\n            \u003cem\u003ereturns the original optional\u003c/em\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e*Optional[T]\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eIfSetOtherwise(f func(v T), notPresent func(), other func())\u003c/code\u003e\u003cbr\u003e\n            if the value was set and is present, calls the supplied function with the value\u003cbr\u003e\n            if the value was set but is not present, calls the supplied notPresent function\u003cbr\u003e\n            otherwise, calls the other func\u003cbr\u003e\n            \u003cem\u003ereturns the original optional\u003c/em\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e\u003ccode\u003e*Optional[T]\u003c/code\u003e\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eIsPresent()\u003c/code\u003e\u003cbr\u003e\n            returns true if the value is present, otherwise false\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003ebool\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eMap(f func(v T) any)\u003c/code\u003e\u003cbr\u003e\n            if the value is present and the result of calling the supplied mapping function returns non-nil, returns\n            an optional describing that returned value\u003cbr\u003e\n            Otherwise returns an empty optional\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e*Optional[any]\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eMarshalJSON()\u003c/code\u003e\u003cbr\u003e\n            implements JSON marshal\u003cbr\u003e\n            if the value is present, returns the marshalled data for the value\u003cbr\u003e\n            Otherwise, returns the marshalled data for null\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e([]byte, error)\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eOrElse(other T)\u003c/code\u003e\u003cbr\u003e\n            returns the value if present, otherwise returns other\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eT\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eOrElseError(err error)\u003c/code\u003e\u003cbr\u003e\n            returns the supplied error if the value is not present, otherwise returns nil\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eerror\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eOrElseGet(f func() T)\u003c/code\u003e\u003cbr\u003e\n            returns the value if present, otherwise returns the result of calling the supplied function\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eT\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eOrElsePanic(v any)\u003c/code\u003e\u003cbr\u003e\n            if the value is not present, panics with the supplied value, otherwise does nothing\u003cbr\u003e\n            \u003cem\u003ereturns the original optional\u003c/em\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e*Optional[T]\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eOrElseSet(v T)\u003c/code\u003e\u003cbr\u003e\n            if the value is not present it is set to the supplied value\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e*Optional[T]\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eScan(value interface{})\u003c/code\u003e\u003cbr\u003e\n            implements sql.Scan\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eerror\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eUnSet()\u003c/code\u003e\u003cbr\u003e\n            clears the set flag (see \u003ccode\u003eWasSet()\u003c/code\u003e)\u003cbr\u003e\n            \u003cem\u003ereturns the original optional\u003c/em\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e*Optional[T]\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eUnmarshalJSON(data []byte)\u003c/code\u003e\u003cbr\u003e\n            implements JSON unmarshal\u003cbr\u003e\n            if the supplied data is null representation, sets the present to false\u003cbr\u003e\n            Otherwise, unmarshal the data as the value and sets the optional to present (unless the result of\n            unmarshalling the value returns an error - in which case the present is set to false)\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eerror\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eWasSet()\u003c/code\u003e\u003cbr\u003e\n            returns true if the last setting operation set the value, otherwise false\u003cbr\u003e\n            Setting operations are \u003ccode\u003eUnmarshalJSON()\u003c/code\u003e, \u003ccode\u003eScan()\u003c/code\u003e and \u003ccode\u003eOrElseSet()\u003c/code\u003e\u003cbr\u003e\n            Use method \u003ccode\u003eUnSet()\u003c/code\u003e to clear this flag alone\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003ebool\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eWasSetElse(other T)\u003c/code\u003e\u003cbr\u003e\n            returns the value if present and set, otherwise returns other\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eT\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eWasSetElseError(err error)\u003c/code\u003e\u003cbr\u003e\n            returns the supplied error if the value is not present and set, otherwise returns nil\u003cbr\u003e\n            if the supplied error is nil and the value is not present and set, a \u003ccode\u003eNotPresentError\u003c/code\u003e is returned\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eerror\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eWasSetElseGet(f func() T)\u003c/code\u003e\u003cbr\u003e\n            returns the value if present and set, otherwise returns the result of calling the supplied function\u003cbr\u003e\n            if the supplied function is nil and the value is not present and set, returns a default empty value\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003eT\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eWasSetElsePanic(v any)\u003c/code\u003e\u003cbr\u003e\n            if the value is not present and set, panics with the supplied value, otherwise does nothing\u003cbr\u003e\n            \u003cem\u003ereturns the original optional\u003c/em\u003e\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e*Optional[T]\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eWasSetElseSet(v T)\u003c/code\u003e\u003cbr\u003e\n            if the value is not present and set it is set to the value supplied\n        \u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e*Optional[T]\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Constructors\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eConstructor function and description\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eOf[T any](value T) *Optional[T]\u003c/code\u003e\u003cbr\u003e\n            Creates a new optional with the supplied value\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eOfNillable[T any](value T) *Optional[T]\u003c/code\u003e\u003cbr\u003e\n            Creates a new optional with the supplied value\u003cbr\u003e\n            If the supplied value is nil, an empty (not present) optional is returned\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eOfNillableString(value string) *Optional[string]\u003c/code\u003e\u003cbr\u003e\n            Creates a new string optional with the supplied value\u003cbr\u003e\n            If the supplied value is an empty string, an empty (not-present) optional is returned\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmpty[T any]() *Optional[T]\u003c/code\u003e\u003cbr\u003e\n            Creates a new empty (not-present) optional of the specified type\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyString() *Optional[string]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003estring\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyInterface() *Optional[interface{}]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003einterface{}\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyInt() *Optional[int]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003eint\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyInt8() *Optional[int8]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003eint8\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyInt16() *Optional[int16]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003eint16\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyInt32() *Optional[int32]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003eint32\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyInt64() *Optional[int64]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003eint64\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyUint() *Optional[uint]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003euint\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyUint8() *Optional[uint8]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003euint8\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyUint16() *Optional[uint16]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003euint16\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyUint32() *Optional[uint32]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003euint32\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003efunc EmptyUint64() *Optional[uint64]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003euint64\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyBool() *Optional[bool]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003ebool\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyFloat32() *Optional[float32]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003efloat32\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyFloat64() *Optional[float64]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003efloat64\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyByte() *Optional[byte]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003ebyte\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\n            \u003ccode\u003eEmptyRune() *Optional[rune]\u003c/code\u003e\u003cbr\u003e\n            returns an empty optional of type \u003ccode\u003erune\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-andiamo%2Fgopt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-andiamo%2Fgopt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-andiamo%2Fgopt/lists"}