Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Go-Learning-Land/Go-Learning-Archive
/ f1
Function
f1
GolangBasics/GoByExample/022Error.go:8–16 ·
view source on GitHub ↗
(arg int)
Source
from the content-addressed store, hash-verified
6
)
7
8
func
f1(arg int) (int, error) {
9
if
arg == 42 {
10
11
return
-1, errors.New(
"can't work with 42"
)
12
13
}
14
15
return
arg + 3, nil
16
}
17
18
type
argError
struct
{
19
arg int
Callers
1
main
Function · 0.70
Calls
1
New
Method · 0.45
Tested by
no test coverage detected