unsafe package
Defines the unsafe operations Go permits and the narrow rules around pointer conversion.
Defines the unsafe operations Go permits and the narrow rules around pointer conversion.
- Author: Go Team
- Authority: primary
- Kind: package-doc
- URL: https://pkg.go.dev/unsafe
What it covers
- unsafe.Pointer rules
- uintptr conversion constraints
- portability and layout caveats
Why authoritative
Official package documentation for one of Go’s sharpest low-level escape hatches.
Use when
- is this unsafe pointer conversion valid in Go
- what does the unsafe package allow here
- is this unsafe code valid across Go versions
Keywords
- unsafe, pointer conversion, uintptr, memory layout, unsafe rules