ZhangZhihui's Blog  

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).

 

 

 

 

 

 

 

posted on 2024-02-20 17:11  ZhangZhihuiAAA  阅读(15)  评论(0)    收藏  举报