blob: a24803e01743f2638a88bf7d765261c6f0645c77 [file] [view]
---
title: InvalidCap
layout: article
---
<!-- Copyright 2023 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file. -->
<!-- Code generated by generrordocs.go; DO NOT EDIT. -->
```
InvalidCap occurs when an argument to the cap built-in function is not of
supported type.
See https://golang.org/ref/spec#Length_and_capacity for information on
which underlying types are supported as arguments to cap and len.
Example:
var s = 2
var x = cap(s)
```