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

Function getAverage

hellogo.go:94–102  ·  view source on GitHub ↗
(nums ...float64)

Source from the content-addressed store, hash-verified

92}
93
94func getAverage(nums ...float64) float64 {
95 var sum float64 = 0.0
96 var numSize float64 = float64(len(nums))
97
98 for _, val := range nums {
99 sum += val
100 }
101 return (sum / numSize)
102}
103
104// ----- FUNCTION THAT EXCEPTS GENERICS -----
105// This generic type parameter is capital, between

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected