[go-nuts] liteide x33.2 released

2018-02-16 Thread visualfc
Hi all. LiteIDE x33.2 released! This version folder tool window add split mode, fix find regex replace. Linux release binary build on ubuntu 16.04, add new ArchLinux PKGBUILD file download. * LiteIDE Home * LiteIDE Source code * Release

Re: [go-nuts] How can I fetch the default locale (server locale not from the request) in Golang

2018-02-16 Thread uwe . dauernheim
Java’s Locale.getDefault returns (if not overridden) the values from the system property “user.language” and “user.region”. If these are not set, it simply returns “en”. See http://hg.openjdk.java.net/jdk8u/jdk8u60/jdk/file/935758609767/src/share/classes/java/util/Locale.java For Linux: These

Re: [go-nuts] Go 1.10 is released

2018-02-16 Thread Andrew Bonventre
Yep! Missed that . Review is out now. On Fri, Feb 16, 2018 at 5:30 PM, Harmen wrote: > On Fri, Feb 16, 2018 at 02:35:44PM -0500, Andrew Bonventre wrote: > > Hello gophers, > > > > We just released Go 1.10. > > > > You can read the announcement blog post here: > >

[go-nuts] All Forms of Wishful Generics

2018-02-16 Thread Mandolyte
I think this falls into a variation of package level generics. Look over the document below and see if there is any changes you would recommend. https://docs.google.com/document/d/1vrAy9gMpMoS3uaVphB32uVXX4pi-HnNjkMEgyAHX4N4/edit?usp=drivesdk Thanks for sharing! -- You received this message

[go-nuts] Re: All Forms of Wishful Generics

2018-02-16 Thread Dave Cheney
I certainly don’t want what happened to C++ to happen to Go. If it’s a choice between obsolescence or being crushed under the weight of self inflicted complexity, I’ll gladly vote with my feet for the former. -- You received this message because you are subscribed to the Google Groups

[go-nuts] Re: All Forms of Wishful Generics

2018-02-16 Thread prades . marq
Go is hot right now just like Rails or Node.js used to be hot. So people feel compelled to use the hip thing right now even when they hate it because of fear of missing out. There are better languages out there like Ada who do everything Go does, including concurrency but better and have

[go-nuts] Re: Proposal: return if any not nil

2018-02-16 Thread Jonathan
Or just change how gofmt formats if statements where the block is a single return statement. if r, err := os.Open( "blah.text"); err != nil { return nil, err } Or if parseable: return r, err if { r, err := os.Open( "blah.txt" ) ; err != nil } I think the first is better, but I'm happy with Go

Re: [go-nuts] context.Context and worker pools

2018-02-16 Thread 'Bryan Mills' via golang-nuts
Pool the resources, not the workers. For example, if your resource is “memory footprint of in-flight requests”, use a semaphore instead. (There is a “worker pool” example in the package docs.) If your resource is a fixed-size set of connections,

Re: [go-nuts] context.Context and worker pools

2018-02-16 Thread Bruno Albuquerque
I did something like this here: https://github.com/brunoga/workerpool I do not store the context anywhere, I pass it to my Start() method and it passes it down to any place I need it. On Fri, Feb 16, 2018 at 1:05 PM andrey mirtchovski wrote: > While trying to retrofit

[go-nuts] Re: Proposal: return if any not nil

2018-02-16 Thread Paul Brousseau
Ah, I just re-read the thread subject: if *any* of the values are non-nil. Sorry for the misunderstanding. On Friday, February 16, 2018 at 3:42:23 PM UTC-7, Paul Brousseau wrote: > > If all of the values are non-nil, then `retnn nil, err` would not return, > would it? Did I miss something? >

[go-nuts] Re: Proposal: return if any not nil

2018-02-16 Thread Paul Brousseau
If all of the values are non-nil, then `retnn nil, err` would not return, would it? Did I miss something? On Friday, February 16, 2018 at 2:38:05 PM UTC-7, Nathan Fisher wrote: > > Hi All, > > I've been contemplating alternative methods to address the "boiler plate" > of error handling in Go.

Re: [go-nuts] Go 1.10 is released

2018-02-16 Thread Harmen
On Fri, Feb 16, 2018 at 02:35:44PM -0500, Andrew Bonventre wrote: > Hello gophers, > > We just released Go 1.10. > > You can read the announcement blog post here: > https://blog.golang.org/go1.10 > > You can download binary and source distributions from our download page: >

[go-nuts] Re: Go 1.10 is released

2018-02-16 Thread Kurt Jung
> > We just released Go 1.10. Nice work! Building multi-file packages is incredibly fast with the new caching system. -- Kurt -- 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,

[go-nuts] Proposal: return if any not nil

2018-02-16 Thread Nathan Fisher
Hi All, I've been contemplating alternative methods to address the "boiler plate" of error handling in Go. One of the main benefits I see to the current approach is that indentation highlights exception paths vs the success path. From a readability perspective I can see the benefit of this

[go-nuts] context.Context and worker pools

2018-02-16 Thread andrey mirtchovski
While trying to retrofit context.Context within a worker-pool-patterned package, where work is sent down a channel to be picked up by number of worker goroutines. I'm running against the mantra of "Do not store Contexts inside a struct type". For example, I want to put a timeout on the amount of

[go-nuts] Go 1.10 is released

2018-02-16 Thread Andrew Bonventre
Hello gophers, We just released Go 1.10. You can read the announcement blog post here: https://blog.golang.org/go1.10 You can download binary and source distributions from our download page: https://golang.org/dl/ To compile from source using a Git checkout, update to the release with "git

Re: [go-nuts] How can I fetch the default locale (server locale not from the request) in Golang

2018-02-16 Thread Anish P
My bad. I was referring to the same.Something which is packaged in go giving a standard locale ID as q_AL, ar_DZ Cheers Anish On Fri, Feb 16, 2018 at 10:08 PM, Ian Lance Taylor wrote: > On Fri, Feb 16, 2018 at 8:21 AM, Anish P > wrote: > > >

Re: [go-nuts] How can I fetch the default locale (server locale not from the request) in Golang

2018-02-16 Thread Ian Lance Taylor
On Fri, Feb 16, 2018 at 8:21 AM, Anish P wrote: > > I'm looking to fetch the IANA timezone. For what it's worth, I don't usually call the timezone a "locale". In programming, "locale" usually refers to language related issues. See

Re: [go-nuts] How can I fetch the default locale (server locale not from the request) in Golang

2018-02-16 Thread Anish P
I'm looking to fetch the IANA timezone. Cheers Anish Thanks and Regards Anish Prabhakaran +91-9901159770 On Fri, Feb 16, 2018 at 9:40 PM, Ian Lance Taylor wrote: > On Fri, Feb 16, 2018 at 7:46 AM, wrote: > > > > The intention is basically

Re: [go-nuts] How can I fetch the default locale (server locale not from the request) in Golang

2018-02-16 Thread Ian Lance Taylor
On Fri, Feb 16, 2018 at 7:46 AM, wrote: > > The intention is basically to send out translations from the deployed shard. > Hence,we are trying to find the locale of the server locale. Because of some > reason, we cannot extract this as an environment variable on

[go-nuts] Client certificate in request missing

2018-02-16 Thread mzoubek
Hello this is my code: https://play.golang.org/p/yxhYXEVMPjB I got certificate in pfx format, I extraced client, CA, private certificate which i imported in my program. # Extract Public Key (ask for password) openssl pkcs12 -in file.pfx -out file_public.pem -clcerts -nokeys # Extract

[go-nuts] Re: All Forms of Wishful Generics

2018-02-16 Thread matthewjuran
Can you write some examples that use these types? Matt On Friday, February 16, 2018 at 6:37:47 AM UTC-6, dc0d wrote: > > “There are only two kinds of languages: the ones people complain about and > the ones nobody uses.” > > ― Bjarne Stroustrup, > > I use other programming languages too -

Re: [go-nuts] How can I fetch the default locale (server locale not from the request) in Golang

2018-02-16 Thread prabhakaran . anish1986
The intention is basically to send out translations from the deployed shard. Hence,we are trying to find the locale of the server locale. Because of some reason, we cannot extract this as an environment variable on the shard or get it from the client. Best Anish On Wednesday, 14 February

[go-nuts] Re: Tweaking sync.Pool for mostly-empty pools

2018-02-16 Thread Carlo Alberto Ferraris
Also, keep in mind, "being there nothing in the pool" is the common state of pools immediately after every GC. On Friday, February 16, 2018 at 12:05:27 PM UTC+9, Kevin Malachowski wrote: > > If there is likely nothing in the Pool, then maybe it's better to not use > one at all. Can you compare

[go-nuts] Re: Tweaking sync.Pool for mostly-empty pools

2018-02-16 Thread Carlo Alberto Ferraris
Kevin, We're already using pool only where it's not hurting performance (compared to a bare new). I could probably come up with ad-hoc pools for specific cases, but the approach I described in my previous mail seemed promising because it makes Pool applicable also in cases where you put in less

[go-nuts] Re: Possible to stream database/sql rows to text/template?

2018-02-16 Thread Matt R.
Oh nice! I was using it with github.com/gin-gonic/gin which was giving me an error about writing bytes exceeding Content-Length, which the library was setting for me. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] Re: Implementation of sync.Once

2018-02-16 Thread dc0d
Thanks! Note To Self (or anyone whom may find it useful): Since sync.Once is usually used for doing initialization, it matters that the consecutive calls wait until the first call to f() gets completed. With provided implementation in the first post, there is no such guarantee. On Friday,

[go-nuts] Re: Implementation of sync.Once

2018-02-16 Thread djadala
On Friday, February 16, 2018 at 3:27:04 PM UTC+2, dc0d wrote: > > Why sync.Once uses a sync.Mutex in addition to atomic functions? > > What are the drawbacks/shortcomings/deficiencies of this implementation? > > type Once struct { > done uint32 > } > > > func (o *Once) Do(f func()) { > if

[go-nuts] Implementation of sync.Once

2018-02-16 Thread dc0d
Why sync.Once uses a sync.Mutex in addition to atomic functions? What are the drawbacks/shortcomings/deficiencies of this implementation? type Once struct { done uint32 } func (o *Once) Do(f func()) { if !atomic.CompareAndSwapUint32(, 0, 1) { return } f() } -- You received this

[go-nuts] Re: All Forms of Wishful Generics

2018-02-16 Thread dc0d
“There are only two kinds of languages: the ones people complain about and the ones nobody uses.” ― Bjarne Stroustrup, I use other programming languages too - obviously. And I will continue to think of better ways to perform Go, if not complaining. Meanwhile this

[go-nuts] Re: All Forms of Wishful Generics

2018-02-16 Thread prades . marq
Have a look at Rust, Ada or even C++, they all have some form of generic programming and are fast or faster than Go. Bonus, none of these use garbage collection. Don't hold your breath with Go getting any substantial changes in its type system. Move on. Developers should use tools that suit

[go-nuts] Re: Experience report with nil interface{}

2018-02-16 Thread Jason E. Aten
> s.rwc, err = NewCloser() This is also failing to check the error before doing something with the value. Prefer tmp, err := NewCloser() if err != nil { return err } s.rwc = tmp -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Experience report with nil interface{}

2018-02-16 Thread 'Axel Wagner' via golang-nuts
Personally, I'd argue that you are misattributing the root cause. The code you posted at least, does not check the error of ensureOpen. If it would have, then it wouldn't have crashed. It is pretty common in Go, to return a valid value if and only if no error is returned alongside it. It is also