lean into examples

This commit is contained in:
Mark McGranaghan
2012-10-09 21:02:12 -07:00
parent 5d1775bdaa
commit 8daa226a48
130 changed files with 4 additions and 4 deletions

21
examples/range/range.go Normal file
View File

@@ -0,0 +1,21 @@
package main
import "fmt"
func main() {
var x [5]float64
x[0] = 98
x[1] = 93
x[2] = 77
x[3] = 82
x[4] = 83
var total float64 = 0
for _, value := range x {
total += value
}
fmt.Println(total / float64(len(x)))
}
// todo: comment on maps
// todo: comment on channels