[go-nuts] Any way to print a 'struct g' within delve/gdb

2019-11-10 Thread Xiangdong JI
Given a valid goroutine structure's pointer, say retrieving from the register 'g', how can I convert it to 'struct g' in delve or gdb? gdb usually reports "A syntax error in expression ...", and delve issues various "Command failed" message (failed to figure the proper way of converting a

Re: [go-nuts] About http: superfluous response.WriteHeader call

2019-11-10 Thread 洪嘉鴻
I see. Thank you very much! Max burak serdar於 2019年11月11日星期一 UTC+8下午1時42分13秒寫道: > > On Sun, Nov 10, 2019 at 10:25 PM 洪嘉鴻 > > wrote: > > > > Hello everyone: > >I'm using golang with Win10. Now I'm trying to write a web > browser. The version of the golang which I am using is 1.12.9.

Re: [go-nuts] About http: superfluous response.WriteHeader call

2019-11-10 Thread burak serdar
On Sun, Nov 10, 2019 at 10:25 PM 洪嘉鴻 wrote: > > Hello everyone: >I'm using golang with Win10. Now I'm trying to write a web browser. > The version of the golang which I am using is 1.12.9. Here is the problem > that I'm encountering: > Here is the code. The code couldn't run with "The

[go-nuts] About http: superfluous response.WriteHeader call

2019-11-10 Thread 洪嘉鴻
Hello everyone: I'm using golang with Win10. Now I'm trying to write a web browser. The version of the golang which I am using is 1.12.9. Here is the problem that I'm encountering: Here is the code. The code couldn't run with "The Go Playground",

Re: [go-nuts] strict type assignability to prevent arbitrary values

2019-11-10 Thread Wojciech S. Czarnecki
On Thu, 7 Nov 2019 02:58:17 -0800 (PST) bsr wrote: > Is there a way I can prevent this behavior. > I am using Status like an enum, and only predefined status values should be > allowed. You cannot statically prevent someone from willfully assigning to a variable of accessible type (eg. a

Re: [go-nuts] liteide x36.2 released.

2019-11-10 Thread H.E
Thanks for the info Very excited to give it a try. On Saturday, 2 November 2019 14:32:48 UTC, visualfc wrote: > > Hi, all. > LiteIDE X36.2 released! > This version fix gocode crash bug. Add new image viewer plugins. Folder > view support multi copy, move to trash. Fix windows floating dock >

Re: [go-nuts] Re: What is the correct way to access/modify slice elements concurrently

2019-11-10 Thread Robert Engels
What I meant was that if you read farther down in the synchronization section atomics are not discussed and the issue cited is related. > On Nov 10, 2019, at 8:31 AM, Robert Engels wrote: > > Ignore the first part (error!) but the issue applies in terms of atomic. > >>> On Nov 10, 2019, at

Re: [go-nuts] Re: What is the correct way to access/modify slice elements concurrently

2019-11-10 Thread Robert Engels
Ignore the first part (error!) but the issue applies in terms of atomic. > On Nov 10, 2019, at 8:08 AM, Lars Seipel wrote: > > On Sat, Nov 09, 2019 at 11:00:04AM -0600, Robert Engels wrote: >> No. Because in the absence on a memory barrier the writes may not be flushed >> meaning you cannot

Re: [go-nuts] Re: What is the correct way to access/modify slice elements concurrently

2019-11-10 Thread Robert Engels
You are reading the section on “single go routine”. That does not apply here as there are multiple go routines. See https://github.com/golang/go/issues/5045 This is still technical undefined by the memory model. > On Nov 10, 2019, at 8:08 AM, Lars Seipel wrote: > > On Sat, Nov 09, 2019 at

Re: [go-nuts] Re: What is the correct way to access/modify slice elements concurrently

2019-11-10 Thread Lars Seipel
On Sat, Nov 09, 2019 at 11:00:04AM -0600, Robert Engels wrote: No. Because in the absence on a memory barrier the writes may not be flushed meaning you cannot reason about any value ever being changed. atomics provide the memory barrier, but the mm still does not specify a “happens before”

[go-nuts] Re: wasm - Browser gets stuck due memory usage

2019-11-10 Thread mihai barbulescu
It seems in the end the issue was actually a deadlock in the event loop. I fixed it by spawning go routines on all the functions interacting with the dom. --- > > I'm trying to build a web/client app using Go (compiled to wasm). The > issue is that the browser(both

[go-nuts] Re: wasm - Browser gets stuck due memory usage

2019-11-10 Thread Elias Naur
Possible duplicate of https://github.com/golang/go/issues/35111 (garbage collection of js.Value references) which was recently fixed. Please try with gotip (https://godoc.org/golang.org/dl/gotip) or build from source. Note that the fix for #35111 made js.Value equality tests a compile time