[go-nuts] Re: syscall/js (wasm): Wrapped func, goroutines, GOMAXPROCS, mutex necessity?

2022-07-03 Thread atd...@gmail.com
Ok so I am still trying to figure out what this paragraph entails: > Invoking the wrapped Go function from JavaScript will pause the event loop and spawn a new goroutine. Other wrapped functions which are triggered during a call from Go to JavaScript get executed on the same goroutine. > As a co

[go-nuts] Re: How do you make a ReadCloser?

2022-07-03 Thread Alex Shi
Note. For ioutil#NopCloser, as of Go 1.16, this function simply calls io.NopCloser. On Friday, July 1, 2022 at 1:09:15 PM UTC+8 Ansuraj Khadanga wrote: > Thats great! Thanks for sharing. > > req.Body = ioutil.NopCloser(bytes.NewReader([]byte("foo"))) > > works! > > On Wednesday, 27 June 2018 at

Re: [go-nuts] noob: type assertion vs reflection

2022-07-03 Thread Ian Lance Taylor
On Sun, Jul 3, 2022 at 1:37 PM Maxime FRYSOU wrote: > > I stumble upon this topic that is very interesting but I'm not 100% sure to > fully understand what you meant when you said: > "Checking for a struct field, embedded or not, can only be done using > reflection. > You can use a (much faster)

Re: [go-nuts] noob: type assertion vs reflection

2022-07-03 Thread Maxime FRYSOU
Hi Ian, I stumble upon this topic that is very interesting but I'm not 100% sure to fully understand what you meant when you said: "Checking for a struct field, embedded or not, can only be done using reflection. You can use a (much faster) type assertion to check for a method." I know it's bee