Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/chai2010/advanced-go-programming-book
/ LoopAdd
Function
LoopAdd
examples/ch3.x/loop/loop.go:8–14 ·
view source on GitHub ↗
(cnt, v0, step int)
Source
from the content-addressed store, hash-verified
6
package
loop
7
8
func
LoopAdd(cnt, v0, step int) int {
9
result := v0
10
for
i := 0; i < cnt; i++ {
11
result += step
12
}
13
return
result
14
}
15
16
func
AsmLoopAdd(cnt, v0, step int) int
Callers
3
main
Function · 0.85
TestLoopAdd
Function · 0.85
BenchmarkLoopAdd
Function · 0.85
Calls
no outgoing calls
Tested by
2
TestLoopAdd
Function · 0.68
BenchmarkLoopAdd
Function · 0.68