[go-nuts] spread operator applied to function calls

2021-08-15 Thread mhh...@gmail.com
Hello, I tried to find a related proposal / draft to attach that to, but I could not find anything in github/go/proposals or the draft repo at googlesource. I wanted to share those small pieces of code because it is lean and it might be a case to think about the spread operator. A bit of cont

[go-nuts] Re: spread operator applied to function calls

2021-08-15 Thread mhh...@gmail.com
for a better one to one comparison, this version includes the missing file read into a separate routine mechanism https://play.golang.org/p/KqmFZpMJFhp sorry for the noise. On Sunday, August 15, 2021 at 2:34:43 PM UTC+2 mhh...@gmail.com wrote: > Hello, > > I tried to find a related proposal / dra

[go-nuts] Re: spread operator applied to function calls

2021-08-15 Thread mhh...@gmail.com
sorry for even more noise i prefer the revised version because - it enforce explicit handle errors handling before the data very much like a sequential error processing in Go when we write `if err != nil{}` - there is not any select / defer that makes it more complex the code - it does no

[go-nuts] Re: spread operator applied to function calls

2021-08-15 Thread mhh...@gmail.com
very much sorry for the noise again ... figured i was missing the context handling to support my opinions... https://play.golang.org/p/mwNYZJrDLrw so there is one select, over the select into the source, to stop asap sending more data, none are into the subsequent processors which keeps the wh

[go-nuts] Re: spread operator applied to function calls

2021-08-15 Thread cpasmaboiteaspam
well, sorry again for the noise. I was definitely too enthusiast, the blog example does all of that *i prefer the revised version because* *- it enforce explicit handle errors handling before the data * * very much like a sequential error processing in Go when we write `if err != nil{}`* *- the

[go-nuts] Re: spread operator applied to function calls

2021-08-15 Thread mhh...@gmail.com
so much noise. sorry i was too enthusiast and realized the bog post did all of that. *i prefer the revised version because* *- it enforce explicit handle errors handling before the data * * very much like a sequential error processing in Go when we write `if err != nil{}`* *- there is not a

[go-nuts] Re: spread operator applied to function calls

2021-08-15 Thread cpasmaboiteaspam
again, sorry for such noise.. I found something a last note to add, i hope t is the last one; I was not happy that toMap handles the closing of the error channel, it makes it less re usable. I figured with generics i could do that nicely, IF, that works as per the draft. https://go2goplay.gol

[go-nuts] Implementation of os.args

2021-08-15 Thread Hamish MacDonald
Hi all I am trying to understand the implementation of os.Args(). The os package says this is implemented in the runtime package file runtime.go contains: var argslice

[go-nuts] Re: spread operator applied to function calls

2021-08-15 Thread mhh...@gmail.com
again, sorry for such noise.. I found something a last note to add, i hope it is the last one; I was not happy that toMap handles the closing of the error channel, it makes it less re usable. I figured with generics i could do that nicely, IF, that works as per the draft. https://go2goplay.go

Re: [go-nuts] Implementation of os.args

2021-08-15 Thread Ian Lance Taylor
On Sun, Aug 15, 2021 at 9:30 AM Hamish MacDonald wrote: > > I am trying to understand the implementation of os.Args(). > > The os package says this is implemented in the runtime package > > file runtime.go contains: > var argslice []string > > //go:linkname os_runtime_args os.runtime_args > func o

[go-nuts] Re: spread operator applied to function calls

2021-08-15 Thread mhh...@gmail.com
i am such a goalchoholic. see the begin(ctx)ctxErr thing... it helped me produce consistent pipe component function signatures in the form of func (ctx ctxErr, data <-chan T) (ctxErr, chan Y) func mainNoComment() { ctx, cancel := context.WithCancel(context.Background()) de

[go-nuts] convert image to pure black and white

2021-08-15 Thread Rijal Asep Nugroho
hello all, I was browsing how to make a golang code to convert an image to pure black and white, but didn't find a suitable one, only got how to convert the image to grayscale. Can anyone help? thank you. Regards, -- You received this message because you are subscribed to the Google Groups "go

Re: [go-nuts] convert image to pure black and white

2021-08-15 Thread 'Dan Kortschak' via golang-nuts
On Mon, 2021-08-16 at 09:22 +0700, Rijal Asep Nugroho wrote: > I was browsing how to make a golang code to convert an image to pure > black and white, but didn't find a suitable one, only got how to > convert the image to grayscale. > Can anyone help? thank you. If you do a greyscale conversion an