A range loop allows iterating over different data structures:
String
Array
Pointer to an array
Slice
Map
Receiving channel
In general, range produces two values for each data structure except a receiving channel, for which it produces a single element (the value).
标签:Slice,produces,range,Go,data,channel From: https://www.cnblogs.com/zhangzhihui/p/18023577