Yes, I also use js.Value.String() .
I have also looked at TypedArray, but that goes from Go into JS types as 
well. One example use case would be for calling JS splice function from Go.



On Friday, October 5, 2018 at 2:04:01 PM UTC-4, Carl Mastrangelo wrote:
>
> While trying out the Wasm compiler, I noticed that the syscall/js mainly 
> has helper functions for converting Go types to Js types, but not the other 
> way around.   I am trying to read the data from an HTML <input 
> type="file"/>.  I add an event listener for the `change` event and want to 
> read the file contents.   The problem is that there doesn't seem to be a 
> way to convert between any dataformat window.FileReader (such as 
> ArrayBuffer, or a UInt8Array), and a []byte.   My work around for now is 
> calling js.Value.String(), and parsing the comma separated decimal numbers.
>
> What is the correct way to do this?    
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to