| --- | |
| title: NonSliceableOperand | |
| 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. --> | |
| ``` | |
| NonSliceableOperand occurs when a slice operation is applied to a value | |
| whose type is not sliceable, or is unaddressable. | |
| Example: | |
| var x = [...]int{1, 2, 3}[:1] | |
| Example: | |
| var x = 1 | |
| var y = 1[:1] | |
| ``` | |