diff --git a/Range.md b/Range.md index 061ffc48..1dece6fb 100644 --- a/Range.md +++ b/Range.md @@ -28,6 +28,8 @@ for i, v := range myArray { If only one value is used on the left of a range expression, it is the 1st value in this table. +
+ | Range expression | 1st value | 2nd value (optional) | notes | |:-----------------|:----------|:---------------------|:------| | array or slice a ` [n]E `, ` *[n]E `, or ` []E ` | index ` i int ` | ` a[i] ` E | @@ -35,6 +37,8 @@ If only one value is used on the left of a range expression, it is the 1st value | map m ` map[K]V ` | key ` k K ` | value ` m[k] ` V | | channel c chan E | element ` e E ` | _none_ | +
+ ## Gotchas When iterating over a slice or map of values, one might try this: