safetypes
safetypes copied to clipboard
Rust like result and option implementation for golang
todo
make api more handy check if option type works in mongodb change repo name "safetypes" to "safe"
example: ``` package main import ( "fmt" safe "github.com/eminarican/safetypes" "encoding/json" ) var jsonBlob = []byte(`[ {"Name": "Platypus"}, {"Name": null} ]`) type Animal struct { Name safe.Option[string] } func main() {...
I very like this repo, but it's confused me. This's a use safetypes's struct ```go type Dog struct { Name Option[string] `json:"name,omitempty"` } ``` json.Unmarshal input json: ```json {"name":"hello"} ```...
Hi, Just a little question. Could be possible to marshal and unmarshal MongoDB structs with Option properties? If you try to Decode a Cursor result, It not fits the Option...