MCPcopy
hub / github.com/cli/cli / ExampleOption_UnwrapOrZero

Function ExampleOption_UnwrapOrZero

pkg/option/option_test.go:59–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

57}
58
59func ExampleOption_UnwrapOrZero() {
60 fmt.Println(o.Some(4).UnwrapOrZero())
61 fmt.Println(o.None[int]().UnwrapOrZero())
62
63 // Output
64 // 4
65 // 0
66}
67
68func ExampleOption_IsSome() {
69 fmt.Println(o.Some(4).IsSome())

Callers

nothing calls this directly

Calls 2

PrintlnMethod · 0.80
UnwrapOrZeroMethod · 0.80

Tested by

no test coverage detected