Re: [go-nuts] Sharing data via Mutex vs. Channel

2018-10-24 Thread 'Reinhard Luediger' via golang-nuts
Thanks that sounds reasonable to me -- 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-nuts+unsubscr...@googlegroups.com. For more options, visit

[go-nuts] Sharing data via Mutex vs. Channel

2018-10-23 Thread 'Reinhard Luediger' via golang-nuts
Hi folks, somwhere on my golang journey ("don't k now where and when") I was teached that mutexes are very expensive and we should prefer to communicate over channels instead of working with mutexes. I trusted it until today. I explained it to our aprentice based on my knowledge and he asked

[go-nuts] Tour Of go Page 8 in Basics does not work.

2018-09-18 Thread 'Reinhard Luediger' via golang-nuts
Hey List, is this the right place to get the tour of go fixed? The example on the following page https://tour.golang.org/basics/8 terminates unexpected with error process took to long. kind regards Reinhard Lüdiger -- You received this message because you are subscribed to the Google

[go-nuts] os.WriteFile not writing files in long running process

2018-09-01 Thread 'Reinhard Luediger' via golang-nuts
Maybe you are running out of sockets due to the missing close on the response body after read -- 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

Re: [go-nuts] Is it possible to unmarshall Json by selecting the struct from a field in the Json?

2018-03-30 Thread 'Reinhard Luediger' via golang-nuts
Maybe https://github.com/mitchellh/mapstructure Will help you a bit -- 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-nuts+unsubscr...@googlegroups.com. For

Re: [go-nuts] Re: Long running task in select case

2018-03-20 Thread 'Reinhard Luediger' via golang-nuts
Yea looks a bit easier  Kind regards Reinhard -- 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-nuts+unsubscr...@googlegroups.com. For more options,

Re: [go-nuts] Re: Long running task in select case

2018-03-20 Thread 'Reinhard Luediger' via golang-nuts
s the effect of having "default" on line 24 as > empty? > > > On 18 March 2018 at 14:21, 'Reinhard Luediger' via golang-nuts < > golan...@googlegroups.com > wrote: > >> I came to the following solution for my long running tasks, using >> go-routines & th

Re: [go-nuts] Re: Long running task in select case

2018-03-20 Thread 'Reinhard Luediger' via golang-nuts
. März 2018 08:46:07 UTC+1 schrieb Sathish VJ: > > Looks like this last one works but also quite complicated. > > One question ... what is the effect of having "default" on line 24 as > empty? > > > On 18 March 2018 at 14:21, 'Reinhard Luediger' via golang-

Re: [go-nuts] Re: Long running task in select case

2018-03-20 Thread 'Reinhard Luediger' via golang-nuts
t; >> On 19 March 2018 at 07:44, Sathish VJ <sath...@gmail.com> wrote: >> > Looks like this last one works but also quite complicated. >> > >> > One question ... what is the effect of having "default" on line 24 as >> empty? >> > &

[go-nuts] Re: Long running task in select case

2018-03-18 Thread 'Reinhard Luediger' via golang-nuts
I came to the following solution for my long running tasks, using go-routines & the context package, https://play.golang.org/p/2V_29lHt4Wn package main import ( "context" "fmt" "time" ) //LongRunningTask func LongRunningTask(ctx context.Context, index int) (err error) { // we'll

Re: [go-nuts] Why should i use interface composistion

2018-03-13 Thread 'Reinhard Luediger' via golang-nuts
Unfortunately I have no tests yet. My plan is to use testify an mockery to generate tests for the Storage interface. I am aware of the fact that this only tests the app code . For testing the database methods we'll start integration tests against a real database., kind regards Reinhard Am

Re: [go-nuts] Why should i use interface composistion

2018-03-13 Thread 'Reinhard Luediger' via golang-nuts
@all thx for your comments I think i understand now how to deal with the advise of small interfaces. -- 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

Re: [go-nuts] Why should i use interface composistion

2018-03-13 Thread 'Reinhard Luediger' via golang-nuts
hi, first of all thanks for your reply. Indeed, the interface arose from the necessity of testing. Have you expierience with a memory sql driver? Could you recommend one? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] Why should i use interface composistion

2018-03-13 Thread 'Reinhard Luediger' via golang-nuts
hi, firstnat all thanks for your reply. Indeed, the interface arose from the necessity of testing. Have you expierience with a memory sql driver? Could you recommend one? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Why should i use interface composistion

2018-03-13 Thread 'Reinhard Luediger' via golang-nuts
Dear all, as far as I know it is recommended to keep actual interfaces as small as possible and to form bigger interfaces via interface composiston. Would be great if the community could advise me what the real benefits are. Lets say i want to create an interface for the database backend like

[go-nuts] if you use sql.NullXYZ, what else do you find yourself doing to make coding easier (or make your code more readable, etc...)

2018-01-27 Thread 'Reinhard Luediger' via golang-nuts
For me it works perfect when I just define each nullable field as a pointer in the struct which represents a da base record. If the struct field is nil it will be null in the database and json encoding handles these fields also correctly -- You received this message because you are