MCPcopy
hub / github.com/samber/mo / Some

Function Some

option.go:22–27  ·  view source on GitHub ↗

Some builds an Option when value is present. Play: https://go.dev/play/p/iqz2n9n0tDM

(value T)

Source from the content-addressed store, hash-verified

20// Some builds an Option when value is present.
21// Play: https://go.dev/play/p/iqz2n9n0tDM
22func Some[T any](value T) Option[T] {
23 return Option[T]{
24 isPresent: true,
25 value: value,
26 }
27}
28
29// None builds an Option when value is absent.
30// Play: https://go.dev/play/p/yYQPsYCSYlD

Callers 15

MapFunction · 0.92
ExampleSomeFunction · 0.85
ExampleOption_someFunction · 0.85
ExampleOption_Size_someFunction · 0.85
ExampleOption_Get_someFunction · 0.85
ExampleOption_Match_someFunction · 0.85

Calls

no outgoing calls

Tested by 15

ExampleSomeFunction · 0.68
ExampleOption_someFunction · 0.68
ExampleOption_Size_someFunction · 0.68
ExampleOption_Get_someFunction · 0.68
ExampleOption_Match_someFunction · 0.68
ExampleOption_Map_someFunction · 0.68