[go-nuts] Can vet report useless assignments in method?

2018-10-22 Thread 'Carl Mastrangelo' via golang-nuts
Hi go nuts, https://play.golang.org/p/ylYlbVMQ24- I recently hit an error where I had been calling methods on a struct. Originally, the fields in the struct were never changed, but after some iterations, i added some state to my struct. The methods which modified the state were always work

[go-nuts] syscall/js: How to pass data from the browser back into Go?

2018-10-05 Thread 'Carl Mastrangelo' via golang-nuts
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 . I add an event listener for the `change` event and want to read the file contents. The

Re: [go-nuts] Unsafe Pointer rules

2018-08-21 Thread 'Carl Mastrangelo' via golang-nuts
Tue, Aug 21, 2018 at 1:19 PM, 'Carl Mastrangelo' via golang-nuts > > wrote: > > > > If I create an unsafe.Pointer that points to an invalid memory address, > but > > I never deference it or otherwise pass it along, what happens to it? > > If you never

[go-nuts] Unsafe Pointer rules

2018-08-21 Thread 'Carl Mastrangelo' via golang-nuts
(to short circuit any question, I have already read https://golang.org/pkg/unsafe/ ) If I create an unsafe.Pointer that points to an invalid memory address, but I never deference it or otherwise pass it along, what happens to it? Is it a valid go program to just create such a pointer? The mai