Re: [go-nuts] Help

2018-09-05 Thread Matthias B.
On Wed, 5 Sep 2018 19:14:43 +0530 Kathiresh Kumar wrote: > How can I connect golang with mongoDB > http://lmgtfy.com/?q=How+can+I+connect+golang+with+mongoDB%3F%3F%3F%3F -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] Generics as builtin typeclasses

2018-09-04 Thread Matthias B.
On Tue, 4 Sep 2018 11:57:02 -0700 (PDT) Matt Sherman wrote: > Here’s a riff on generics focused on builtin typeclasses (instead of > user contracts): https://clipperhouse.com/go-generics-typeclasses/ > > Feedback welcome. > The main motivation behind generics has always been type-safe

Re: [go-nuts] gofmt formats different than goimports in go1.11

2018-08-28 Thread Matthias B.
On Tue, 28 Aug 2018 22:56:24 +0530 Rohit Jain wrote: > > how do I solve this? > Wait for goimports to be updated. Until then, increase the dose of your OCD medication till you stop caring about the difference. MSB -- It was funnier inside my head. -- You received this message because you

Re: [go-nuts] Re: Ternary ... again

2018-08-17 Thread Matthias B.
On Thu, 16 Aug 2018 16:54:35 -0700 Liam Breck wrote: > Indeed, the problem is largely go fmt, I already raised this, but no > one picked up on it: > > I use this one-liner: > > v := a; if t { v = b } > > This is not compatible with go fmt, but that tool's effects are > undocumented (see issue

Re: [go-nuts] Re: Ternary ... again

2018-08-16 Thread Matthias B.
On Wed, 15 Aug 2018 07:46:51 -0700 (PDT) Hoo Luu wrote: > 在 2018年8月15日星期三 UTC+8上午12:43:37,Mark Volkmann写道: > > > var color = temperature > 100 ? “red” : “blue” > > > Although this feature will not be accepted, we could just talk about > it. I prefer 'if-expression' to ternary. > > var

Re: [go-nuts] Re: Is the memory allocated for x in f guaranteed to be reachable after a GC call?

2018-05-26 Thread Matthias B.
On Sat, 26 May 2018 07:26:12 -0700 (PDT) T L wrote: > Looks the answer is not. But any one can confirm this? I can tell you that your program does not have any defined behavior according to the Go language standard, because your use of unsafe.Pointer to reinterpret bytes as

Re: [go-nuts] Does Golang need the innovation of C++ move semantics too

2018-05-26 Thread Matthias B.
On Sat, 26 May 2018 03:15:45 + Li Jianhua wrote: > 1. Why does C++ introduce move semantics anyway? What problems is > it going to solve? 2. How come Golang, C (Without ++) don’t have > that move semantics yet? Will they need the move soon? > C++ is a language used

Re: [go-nuts] golang maps; using slice as a key

2018-05-23 Thread Matthias B.
On Wed, 23 May 2018 03:03:18 -0700 (PDT) lafolle wrote: > Thanks Mathias for clearing this out. > > I reasoned this out by looking at the address to which `i` was > allocated to, though I wanted to _peek_ inside the slice's header to > be affirmative. But I can't clearly

Re: [go-nuts] golang maps; using slice as a key

2018-05-23 Thread Matthias B.
On Wed, 23 May 2018 13:29:17 +0530 Sankar P wrote: > I extracted the confusing part alone, when appending to an array, the > items are different than the resultant array into a separate go > program. > > The Playground URL is: https://play.golang.org/p/BJM0H_rYNdb >

Re: [go-nuts] Go license and fitness for purpose

2018-05-15 Thread Matthias B.
On Tue, 15 May 2018 06:39:40 -0700 (PDT) matthewju...@gmail.com wrote: > I don’t think I’m suggesting to not disclaim liability. I’m > suggesting to claim that I didn’t hide anything to make a use break > on purpose. It does add liability, but this is liability that is > completely in the

Re: [go-nuts] Go license and fitness for purpose

2018-05-13 Thread Matthias B.
On Sun, 13 May 2018 08:56:08 -0700 (PDT) matthewju...@gmail.com wrote: > My tools are my responsibility, so I’m wondering what stops the GCC, > Go, or other open source authors from including practical jokes. That depends on the jurisdiction and the kind of practical joke. But it's a fact that

Re: [go-nuts] os/exec always fails with fork/exec /usr/bin/qemu-img: invalid argument

2018-05-13 Thread Matthias B.
On Fri, 11 May 2018 20:36:18 -0700 (PDT) Tashi Lu wrote: > Hi gophers, > > I faced a strange problem: os/exec always fails with `fork/exec > /usr/bin/qemu-img: invalid argument'. > > Simplified code is at https://play.golang.org/p/v1APfzmS2p9. It seems > this

Re: [go-nuts] Bug or not?

2018-05-10 Thread Matthias B.
On Thu, 10 May 2018 08:33:32 + Jan Mercl <0xj...@gmail.com> wrote: > This modified example from another thread does not compile: You modified it in a pretty significant way. The original example had type T = *T which is a recursive type alias (which is disallowed). Your new example has