Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-07 Thread Jakub Labath
Sunday, July 7, 2019 at 5:37:38 AM UTC, Lucio wrote: > > On 7/6/19, Jakub Labath > wrote: > > "And yes go does have panic/recover - but I never use them for the same > reasons I > > dislike exceptions. It's just really hard to reason about such jumps in > lo

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-05 Thread Jakub Labath
But it's not a binary question. If you ask me Would like go to have Maybe/Option type instead of val, err - then I can say yes. Would you like to have something such as Rust's Result instead of val, err - then I can say yes (even though I understand this may not be possible due to generics etc

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-05 Thread Jakub Labath
Sorry but how do you know we are a minority? I dislike the try proposal for all the reasons already mentioned by others. I did fill out the survey but I do not remember there being an option to say this simple thing. While I dislike the verbose error handling it's many times better than intro

[go-nuts] Re: the Dominance of English in Programming Languages

2019-05-18 Thread Jakub Labath
Back in the 90ies someone at Microsoft had the brilliant idea to translate Visual Basic that came with the Czech version of Excel into Czech. So e.g. IF became KDYZ (well it's not Z it's Z with caron - which also was a problem if character encoding was not set properly) The results were that n

[go-nuts] Re: Multiple HTTP Clients best practice

2017-09-06 Thread Jakub Labath
My first instinct is to simply use one http.Client per each micro service. So when talking to microservice A - i would retrieve the client for microservice A from somewhere. The immediate gain is that it presumably already has tcp connection (or several) open to the service A. It is also possi

Re: [go-nuts] Priority cases in select?

2017-01-25 Thread Jakub Labath
Glad someone mentioned reflect.Select. Implemented simple round robin solution with a timeout case (if no data is available at all) using just that . To add to some priority would be just be a matter of setting the channel/cases to nil after several writes, rather than just after one like I do

[go-nuts] Re: Do you guys use ORMs when working with SQL?

2016-12-29 Thread Jakub Labath
methods, and when querying one simply omits listing the columns. Here my attempt at the above - https://github.com/jlabath/dbi Cheers Jakub Labath On Tuesday, December 27, 2016 at 10:00:05 PM UTC, Zippoxer wrote: > > I haven't written SQL for years. I was enjoying MongoDB with the awe

[go-nuts] Re: unmarshaling json to byte type

2016-09-15 Thread Jakub Labath
While you can use the solution suggested by Viktor. I do wonder what exactly is the point of the byte type? I mean byte is just uint8 just like it says above. So really if you want number between 0 and 255 you can just send along the number. This is gonna be more readable than some text encoding