mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 04:23:41 +00:00
all: clean up code with Go 1.24+ in mind (#5489)
* all: clean up code with Go 1.24+ in mind * all: more old go cleanup * all: even remove rand_fastrand64 * runtime: revert rand changes * runtime: re-drop rand_fastrand64
This commit is contained in:
@@ -160,12 +160,7 @@ func write(fd uintptr, p unsafe.Pointer, n int32) int32 {
|
||||
if fd == 2 { // stderr
|
||||
// Convert to a string, because we know that p won't change during the
|
||||
// call to printstring.
|
||||
// TODO: use unsafe.String instead once we require Go 1.20.
|
||||
s := _string{
|
||||
ptr: (*byte)(p),
|
||||
length: uintptr(n),
|
||||
}
|
||||
str := *(*string)(unsafe.Pointer(&s))
|
||||
str := unsafe.String((*byte)(p), int(n))
|
||||
printstring(str)
|
||||
return n
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user