Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
102
func
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
111
func
double(i int) int {
112
return
i * 2
Callers
nothing calls this directly
Calls
2
Println
Method · 0.80
Map
Method · 0.80
Tested by
no test coverage detected