syscall/js: no method to convert TypedArrays into slices #30210
Labels
arch-wasm
WebAssembly issues
FeatureRequest
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
You can convert a Go slice into a TypedArray by using
js.TypedArrayOf(...)
, but there is apparently no way of doing the reverse operation.You can write a function to
Index()
every byte value in an ArrayBuffer and put them in a byte slice, but this is cumbersome and incurs unacceptable overhead. There should be a function to directly copy the bytes into the Go heap, such as whatjs.Value.String()
does.The text was updated successfully, but these errors were encountered: