mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
c43958972c
This adds support for unsafe.SliceData, unsafe.String, and unsafe.SringData that were introduced in Go 1.20.
16 lines
254 B
Go
16 lines
254 B
Go
package main
|
|
|
|
import "unsafe"
|
|
|
|
func unsafeSliceData(s []int) *int {
|
|
return unsafe.SliceData(s)
|
|
}
|
|
|
|
func unsafeString(ptr *byte, len int16) string {
|
|
return unsafe.String(ptr, len)
|
|
}
|
|
|
|
func unsafeStringData(s string) *byte {
|
|
return unsafe.StringData(s)
|
|
}
|