Skip to content

Commit c5f81e8

Browse files
committed
Merge pull request #32 from NeonXP/patch-1
Update chapter-06-arrays-slices-maps.md
2 parents 625ce0e + 9fe04ac commit c5f81e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_book/chapter-06-arrays-slices-maps.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ layout: "chapter"
7676

7777
$ go run tmp.go
7878
# command-line-arguments
79-
.\tmp.go:19: invalid operation: total / 5 (mismatched types float64 and int)
79+
.\tmp.go:19: invalid operation: total / len(x) (mismatched types float64 and int)
8080

8181
Проблема в том, что `len(x)` и `total` имеют разный тип. `total` имеет тип
8282
`float64`, а `len(x)``int`. Так что, нам надо конвертировать `len(x)` в

0 commit comments

Comments
 (0)