We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 625ce0e + 9fe04ac commit c5f81e8Copy full SHA for c5f81e8
src/_book/chapter-06-arrays-slices-maps.md
@@ -76,7 +76,7 @@ layout: "chapter"
76
77
$ go run tmp.go
78
# command-line-arguments
79
- .\tmp.go:19: invalid operation: total / 5 (mismatched types float64 and int)
+ .\tmp.go:19: invalid operation: total / len(x) (mismatched types float64 and int)
80
81
Проблема в том, что `len(x)` и `total` имеют разный тип. `total` имеет тип
82
`float64`, а `len(x)` — `int`. Так что, нам надо конвертировать `len(x)` в
0 commit comments