[go-nuts] Project architecture

2017-03-11 Thread Tamás Gulácsi
Factor out the cgo related part into a wrapper package (subdir), that will help with the compile times. -- 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-nu

[go-nuts] Re: Project architecture

2017-03-11 Thread Matt Ho
If you're just starting out the project, by all means start with the monolith where everything is together. If you decide it's necessary, over time you can split out the project into what you've discovered you need. Trying to abstract the components you think you'll need too early is a good

[go-nuts] Project architecture

2017-03-11 Thread James Pettyjohn
I'm looking at the pros and cons of how to architect a web project. 1) One is a single go project for a site. No service dependencies for the backend at all. Certain aspects of this means a cgo dependency which is not ideal as it complicates containerization and slows build time. One plus to th

[go-nuts] Re: [ANN] fsq 1.4.0 released

2017-03-11 Thread Daniel Theophanes
That's cool! I would suggest however that you also checking y.go, as is conventional in go. That way "go get" works out of box, and is one less step to install. Thanks for the tool, every once in a while I want something like this. -Daniel On Saturday, March 11, 2017 at 12:22:26 PM UTC-8, Rob

Re: [go-nuts] watchpoint on "private" variables with Gdb

2017-03-11 Thread Ian Lance Taylor
On Sat, Mar 11, 2017 at 10:45 AM, Basile Starynkevitch < bas...@starynkevitch.net> wrote: > Hello all, > > I'm debugging the 5d6c770eb29ae0a33 > > commit of my monimelt pro

[go-nuts] [ANN] fsq 1.4.0 released

2017-03-11 Thread robert . upcraft
Hi, I've been working on this project for about a year now, so I figured I'd finally post something on this list... fsq is a BSD-licensed command line tool for querying the file system. It aims to use efficient I/O when possible, but most of all, strives to to make it easy to write readable f

[go-nuts] watchpoint on "private" variables with Gdb

2017-03-11 Thread Basile Starynkevitch
Hello all, I'm debugging the 5d6c770eb29ae0a33 commit of my monimelt program on github. I don't understand very well how init functions work (and I probably don't unde

Re: [go-nuts] Supervisor Trees in Go

2017-03-11 Thread dc0d
"Chances are it is a less useful construction in Go"; (IMHO too) is correct - commonly speaking. Though I've had this observation that lots of repetitive code abstraction happens and still there is no one de-facto tool/lib/practice how tackle these. Again I think nothing can be compared to Erla

Re: [go-nuts] Supervisor Trees in Go

2017-03-11 Thread Jesper Louis Andersen
If you try this in a real system, I'd be interested in how it fares. In Erlang, initialization in a supervision tree is synchronous with the process initialization. That is, the supervisor doesn't continue with its children stack unless the process successfully initialized. Making sure the gorouti

Re: [go-nuts] how to use go generate to generate generic code .

2017-03-11 Thread Michael Jones
Very nice! Just the kind of use that comes up for me. The one complexity I had when I did this for the standard sort was dealing with the float32 and float64 types, where comparison was more complicated and elaborate in the presence of NaN values. Still, this kind of compile-time type templating i

[go-nuts] how to use go generate to generate generic code .

2017-03-11 Thread Сергей Камардин
Hi! You also could use C preprocessor to make such things. I have used it to generate some generics algorithms to increase performance and reduce interfaces overhead. It is not the best approach, but it could be useful and powerful. FYI: https://github.com/gobwas/ppgo -- You received this mes

Re: [go-nuts] Re: how to use go generate to generate generic code .

2017-03-11 Thread Egon
On Saturday, 11 March 2017 02:27:49 UTC+2, Tyler Compton wrote: > > If we assume a more useful generic task than writing a min function, > what's wrong with using code generation? > There's nothing wrong with in it of itself. It's a tool like any other. Based on the limited information presented

Re: [go-nuts] Supervisor Trees in Go

2017-03-11 Thread dc0d
Yes, this one is using context.Context. On Saturday, March 11, 2017 at 3:00:38 PM UTC+3:30, Jakob Borg wrote: > > Interesting. I'm a fan of http://github.com/thejerf/suture/ which has a > similar goal but different implementation (and predates Context). > > //jb > > On 11 Mar 2017, at 09:19, dc0

[go-nuts] Re: Map value assignment inside if loop

2017-03-11 Thread Roberto Zanotto
Here's the code on the playground to experiment https://play.golang.org/p/GQG-g84nM2 I believe the problem is at line 9 (and 19, but line 9 is the one we observe). You are using ":=" (short variable declaration) to assign the newly created data, but that does not assign the variable in the funct

Re: [go-nuts] Map value assignment inside if loop

2017-03-11 Thread Jesse McNelis
On Sat, Mar 11, 2017 at 10:14 PM, priyank pulumati wrote: > Hello, > Go newbie here > > func (data map[string] interface {}) { > if len(data) == 0 { > data := make(map[string]interface{}) > data["user"], _ = store.GetUser(context.Get(req, "userid").(string)) > } else { > data["user"], _ = sto

[go-nuts] Map value assignment inside if loop

2017-03-11 Thread priyank pulumati
Hello, Go newbie here func (data map[string] interface {}) { if len(data) == 0 { data := make(map[string]interface{}) data["user"], _ = store.GetUser(context.Get(req, "userid").(string)) } else { data["user"], _ = store.GetUser(context.Get(req, "userid").(string)) } log.Println(data["user"]

Re: [go-nuts] Supervisor Trees in Go

2017-03-11 Thread Jakob Borg
Interesting. I'm a fan of http://github.com/thejerf/suture/ which has a similar goal but different implementation (and predates Context). //jb > On 11 Mar 2017, at 09:19, dc0d wrote: > > It just started as playing around recursive types in Go and ended up writing > this. Though I could not f

[go-nuts] Supervisor Trees in Go

2017-03-11 Thread dc0d
It just started as playing around recursive types in Go and ended up writing this . Though I could not find a clean way ti implement rest_for_one strategy and error handling and simple_one_for_one is in TODO list; any feedback would be appreciated! (https://g