MCPcopy
hub / github.com/cli/cli / ExampleMap

Function ExampleMap

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

Source from the content-addressed store, hash-verified

100}
101
102func ExampleMap() {
103 fmt.Println(o.Map(o.Some(2), double))
104 fmt.Println(o.Map(o.None[int](), double))
105
106 // Output:
107 // Some(4)
108 // None
109}
110
111func double(i int) int {
112 return i * 2

Callers

nothing calls this directly

Calls 2

PrintlnMethod · 0.80
MapMethod · 0.80

Tested by

no test coverage detected