| --- | |
| title: BadOffsetofSyntax | |
| 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. --> | |
| ``` | |
| BadOffsetofSyntax occurs when unsafe.Offsetof is called with an argument | |
| that is not a selector expression. | |
| Example: | |
| import "unsafe" | |
| var x int | |
| var _ = unsafe.Offsetof(x) | |
| ``` | |