https://github.com/alecthomas/unsafeslice
Unsafe zero-copy slice casts for Go
https://github.com/alecthomas/unsafeslice
Last synced: over 1 year ago
JSON representation
Unsafe zero-copy slice casts for Go
- Host: GitHub
- URL: https://github.com/alecthomas/unsafeslice
- Owner: alecthomas
- License: mit
- Created: 2013-06-17T18:59:33.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2024-11-23T14:49:51.000Z (over 1 year ago)
- Last Synced: 2025-03-30T13:10:15.320Z (over 1 year ago)
- Language: Go
- Size: 7.81 KB
- Stars: 37
- Watchers: 4
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unsafe zero-copy slice casts for Go
Convenience functions for casting raw bytes to typed arrays without copying.
Usage:
```go
b := []byte{1, 2, 3, 4}
v := unsafeslice.Uint32SliceFromByteSlice(b)
```