> For the complete documentation index, see [llms.txt](https://openai.gitbook.io/code-cheatsheets/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://openai.gitbook.io/code-cheatsheets/all/go/collections.md).

# README

## Collections

len(\[some col])

Go passes a copy of collections by default

`sort` package has sorting e.g `sort.Strings([collection])`

### Iteration

```go
for i := range colors { //set i to current index    
    fmt.Println(colors[i])
}
```

## usage

* `len(colors)`
