MCPcopy Index your code
hub / github.com/cli/cli / ExampleOption_UnwrapOr

Function ExampleOption_UnwrapOr

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

Source from the content-addressed store, hash-verified

35}
36
37func ExampleOption_UnwrapOr() {
38 fmt.Println(o.Some(4).UnwrapOr(3))
39 fmt.Println(o.None[int]().UnwrapOr(3))
40 // Output:
41 // 4
42 // 3
43}
44
45func ExampleOption_UnwrapOrElse() {
46 fmt.Println(o.Some(4).UnwrapOrElse(func() int {

Callers

nothing calls this directly

Calls 2

PrintlnMethod · 0.80
UnwrapOrMethod · 0.80

Tested by

no test coverage detected