Re: [go-nuts] Testing Changes to a Forked Module Dependency (go.mod problems)

2020-01-01 Thread Dan Kortschak
Though also see https://github.com/golang/go/issues/26640 On Wed, 2020-01-01 at 23:24 -0700, burak serdar wrote: > On Wed, Jan 1, 2020 at 10:25 PM wrote: > > > > I've been working on something that uses a package that I have > > imported. > > > > During the development I wanted to improvement

[go-nuts] Re: How to correctly json.Unmarshal struct whose embedded structs define UnmarshalJSON

2020-01-01 Thread Ben Bullock
On Thursday, 2 January 2020 15:01:15 UTC+9, Glen Huang wrote: > > @Ben > > My real world use case is that I have these types that dealing with user > signing up/loging in > > type LogIn struct { > Name string > Password string > } > > type SignUp struct { > Name string > Password string

Re: [go-nuts] Testing Changes to a Forked Module Dependency (go.mod problems)

2020-01-01 Thread burak serdar
On Wed, Jan 1, 2020 at 10:25 PM wrote: > > I've been working on something that uses a package that I have imported. > > During the development I wanted to improvement on the package that I use. > Since I'm anticipating a pull request I forked the module repo (which > contains a `go.mod`) and

[go-nuts] Re: How to correctly json.Unmarshal struct whose embedded structs define UnmarshalJSON

2020-01-01 Thread Glen Huang
@Ben My real world use case is that I have these types that dealing with user signing up/loging in type LogIn struct { Name string Password string } type SignUp struct { Name string Password string Gender string } I was hoping that I cloud embed LogIn inside SignUp, to eliminate

[go-nuts] Testing Changes to a Forked Module Dependency (go.mod problems)

2020-01-01 Thread rwx
I've been working on something that uses a package that I have imported. During the development I wanted to improvement on the package that I use. Since I'm anticipating a pull request I forked the module repo (which contains a `go.mod`) and pull down a local copy. Obviously I cannot import

Re: [go-nuts] loop & CX register

2020-01-01 Thread Vincent Blanchon
I got it, Thank you Ian! Le jeudi 2 janvier 2020 07:36:39 UTC+4, Ian Lance Taylor a écrit : > > On Wed, Jan 1, 2020 at 7:25 PM Vincent Blanchon > > wrote: > > > > Here is a loop in Go: https://play.golang.org/p/G4wdLi26LZ4 > > With looking at the assembly, I can see that the loop counter

Re: [go-nuts] loop & CX register

2020-01-01 Thread Ian Lance Taylor
On Wed, Jan 1, 2020 at 7:25 PM Vincent Blanchon wrote: > > Here is a loop in Go: https://play.golang.org/p/G4wdLi26LZ4 > With looking at the assembly, I can see that the loop counter uses AX > register while the total (t) use the CX register: > > 0x004c 00076 (main.go:7) INCQ AX > 0x004f 00079

[go-nuts] loop & CX register

2020-01-01 Thread Vincent Blanchon
Hi, Here is a loop in Go: https://play.golang.org/p/G4wdLi26LZ4 With looking at the assembly, I can see that the loop counter uses *AX* register while the total (t) use *the CX* register: 0x004c 00076 (main.go:7) INCQ AX 0x004f 00079 (main.go:8) ADDQ DX, CX I have a basic knowledge of

[go-nuts] Re: How to correctly json.Unmarshal struct whose embedded structs define UnmarshalJSON

2020-01-01 Thread Ben Bullock
On Tuesday, 31 December 2019 19:21:07 UTC+9, Glen Huang wrote: > > I want to unmarshal a struct that contains embedded structs: > > type Parent struct { > Child > P int > } > > > type Child struct { > Grandchild > C int > } > > > type Grandchild struct { > G int > } > > The problem is that

Re: [go-nuts] tcp/ip stack for bare metal

2020-01-01 Thread Devon H. O'Dell
Hi Steve, You might take a look at the stack implemented in https://github.com/google/gvisor. —dho On Wed, Jan 1, 2020 at 13:16 Steve Simon wrote: > hi, > > please forgive a newbie question but is there a production ready tcp/ip > stack written in go? > > i would like to run go on bare metal

[go-nuts] tcp/ip stack for bare metal

2020-01-01 Thread Steve Simon
hi, please forgive a newbie question but is there a production ready tcp/ip stack written in go? i would like to run go on bare metal on a fairly grunty cpu - not running hosted simplifies the dependency tree for product release. i need only a trivial filesystem and (i think) no other OS

Re: [go-nuts] Mongo Go Models (mgm), MongoDB ODM for Go

2020-01-01 Thread mehr . prs
Thanks Linker, We try to make it best ODM for Go On Wednesday, January 1, 2020 at 6:30:30 PM UTC+3:30, Linker wrote: > > It sounds great! > > On Wed, Jan 1, 2020 at 1:58 AM > wrote: > >> Mongo Go Models (mgm) is open-source and >> makes mongo search and aggregate

Re: [go-nuts] Mongo Go Models (mgm), MongoDB ODM for Go

2020-01-01 Thread Linker
It sounds great! On Wed, Jan 1, 2020 at 1:58 AM wrote: > Mongo Go Models (mgm) is open-source and > makes mongo search and aggregate super easy to do in Golang. > > It's easy to config Mongo's go driver. > > All Mongo operators are predefined so you don't have to

[go-nuts] Re: How to correctly json.Unmarshal struct whose embedded structs define UnmarshalJSON

2020-01-01 Thread Space A.
1. I think it's not correct to use terms "parent" and "child", as Go is not an OOP language. 2. Please note that what you call a Child is actually a Parent, and vice versa. This puts a lot of confusion. 3. Embedding struct will get methods of embedded (depending on whether they've been defined