Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/mmcgrana/gobyexample
/ f
Function
f
examples/custom-errors/custom-errors.go:25–32 ·
view source on GitHub ↗
(arg int)
Source
from the content-addressed store, hash-verified
23
}
24
25
func
f(arg int) (int, error) {
26
if
arg == 42 {
27
28
// Return our custom error.
29
return
-1, &argError{arg,
"can't work with it"
}
30
}
31
return
arg + 3, nil
32
}
33
34
func
main() {
35
Callers
1
main
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected