# Three-Index Slices in Go 1.2

DevFeed: [Three-Index Slices in Go 1.2](<https://devfeed.tech/articles/three-index-slices-in-go-1-2-22090.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2013/12/three-index-slices-in-go-12.html>)

Published: 2013-12-17T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [Go Language](<https://devfeed.tech/topics/go-language.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [ardan-labs](<https://devfeed.tech/tags/ardan-labs.md>), [blog](<https://devfeed.tech/tags/blog.md>), [capacity](<https://devfeed.tech/tags/capacity.md>), [code](<https://devfeed.tech/tags/code.md>), [go](<https://devfeed.tech/tags/go.md>), [go-programming](<https://devfeed.tech/tags/go-programming.md>), [golang](<https://devfeed.tech/tags/golang.md>), [index](<https://devfeed.tech/tags/index.md>), [programming](<https://devfeed.tech/tags/programming.md>), [slices](<https://devfeed.tech/tags/slices.md>)

## AI overview

This tutorial explains the three-index slice feature introduced in Go 1.2. It shows how restricting a slice's capacity provides more control over append operations and protects the underlying array from unintended access.

## Source excerpt

With the release of Go 1.2, slices gained the ability to specify the capacity when performing a slicing operation. This doesn't mean we can use this index to extend the capacity of the underlying array. It means we can create a new slice whose capacity is restricted. Restricting the capacity provides a level of protection to the underlying array and gives us more control over append operations. Here are the release notes and design document for the feature request: External resource on tip.golang.org: http://tip.golang.org/doc/go1.2#three_index External resource on docs.google.com: https://docs.google.com/document/d/1GKKdiGYAghXRxC2BFrSEbHBZZgAGKQ-yXK-hRKBo0Kk/pub Let's write some code to explore using the new capacity index. As with all my slice posts, I am going to use this InspectSlice function: