| --- |
| title: InvalidUnsafeAdd |
| 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. --> |
| |
| ``` |
| InvalidUnsafeAdd occurs when unsafe.Add is called with a |
| length argument that is not of integer type. |
| It also occurs if it is used in a package compiled for a |
| language version before go1.17. |
| |
| Example: |
| import "unsafe" |
| |
| var p unsafe.Pointer |
| var _ = unsafe.Add(p, float64(1)) |
| ``` |
| |