MCPcopy Create free account
hub / github.com/derekbanas/Go-Tutorial / useFunc

Function useFunc

hellogo.go:270–272  ·  view source on GitHub ↗

----- CLOSURES ----- Pass a function to a function

(f func(int, int) int, x, y int)

Source from the content-addressed store, hash-verified

268// ----- CLOSURES -----
269// Pass a function to a function
270func useFunc(f func(int, int) int, x, y int) {
271 pl("Answer :", (f(x, y)))
272}
273
274func sumVals(x, y int) int {
275 return x + y

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected