[go-nuts] Re: undefined (type *math/rand.Rand has no field or method randIntn)

2020-02-25 Thread Anjana Prabhakar
Thank you. On Wednesday, 26 February 2020 01:03:35 UTC+5:30, Jake Montgomery wrote: > > > On Tuesday, February 25, 2020 at 1:42:31 PM UTC-5, Anjana Prabhakar wrote: >> >> I get the error as r1.randIntn undefined (type *math/rand.Rand has no >> field or method randIntn). Please help. >> > > The me

Re: [go-nuts] undefined (type *math/rand.Rand has no field or method randIntn)

2020-02-25 Thread Anjana Prabhakar
Thank you. On Wednesday, 26 February 2020 00:16:29 UTC+5:30, burak serdar wrote: > > On Tue, Feb 25, 2020 at 11:42 AM Anjana Prabhakar > > wrote: > > > > Hi All, > > > > I am trying to generate a random integer using the below code snippet: > > package ABC > > import ( > > * > > "math

Re: [go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread Jon Conradt
It is nice to see the clarification. I can understand not using a GC language in the OS, but the previous wording did sound like it was unwelcome in their user land tools. Progress in getting their port of Go into the CI system would be encouraging. Jon On Tuesday, February 25, 2020 at 8:45

Re: [go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread Ian Lance Taylor
On Tue, Feb 25, 2020 at 9:22 AM Jon Conradt wrote: > > The Fuchsia Programming Language Policy gives some insight into the > experience the Fuchsia team has had with Go, and it doesn't sound good. > > "The Fuchsia Platform Source Tree has had negative implementation experience > using Go. The sy

[go-nuts] Re: Fuchsia Programming Language Policy

2020-02-25 Thread G Shields
They made a political decision, Not supporting GO in the new OS or a GO GUI is a show stopper. After Unladen Swallow and others https://killedbygoogle.com/ I am, No longer interested in GO On Tuesday, February 25, 2020 at 9:22:11 AM UTC-8, Jon Conradt wrote: > > The Fuchsia Programming Language

Re: [go-nuts] Converting *byte to unsafe.Pointer and back to *byte

2020-02-25 Thread robert engels
Maybe an artifact of the C to Go automatic translation tool. > On Feb 25, 2020, at 5:29 PM, 'Keith Randall' via golang-nuts > wrote: > > > > On Tuesday, February 25, 2020 at 4:10:46 AM UTC-8 dmitry@jetbrains.com > wrote: > What is the meaning of the conversion > > var b []byte >

[go-nuts] Re: Go 1.14 is released

2020-02-25 Thread Juan Vargas
Mil Gracias Carlos. Juan On Tue, Feb 25, 2020 at 4:41 PM Carlos Amedee wrote: > Hello gophers, > > We just released Go 1.14. > > To find out what has changed in Go 1.14, read the release notes: > https://golang.org/doc/go1.14 > > You can download binary and source distributions from our downloa

[go-nuts] Unable to pull Golang 1.14-alpine3.11 using Docker

2020-02-25 Thread Sean Farrow
Hi, I'm having an issue whilst attempting to pull the Docker image golang:1.14.0-alpine3.11 using version 2.2.0.3 (with Docker engine 19.03.5) of Docker for windows. I get the response that there is no matching manifest for linux/amd64 in the manifest list. I am able to pull 1.13.8-alpine3.11

[go-nuts] how to dynamic define a member in struct

2020-02-25 Thread Zhihong GUO
Hello all, I am using mongo-go-driver to replace globalsign-mgo, I want to write a new module for mongo-go instead of changing directly the existing module running on globalsign-mgo. I facing a problem, there is a common data structure defined as below: type Meeting struct { // Id of the Meeti

Re: [go-nuts] Understind how to apply timeout using gouritine

2020-02-25 Thread Juan Mamani
Hi Michel, I've tried your sample with this result: 2020/02/25 23:12:51.854561 Stop in 2s 2020/02/25 23:12:51.854710 Hey! 2020/02/25 23:12:57.854967 Bye Bye! But function still running."Bye Bye" appeared +6s later. I will check Context package as you recomended me. Thanks! El martes, 25 de

Re: [go-nuts] Understind how to apply timeout using gouritine

2020-02-25 Thread Juan Mamani
Ok, you are right. But I was confused with this: 2009/11/10 23:00:00 -Start 2009/11/10 23:00:00 Sleeping 8 seconds..2009/11/10 23:00:03 Canceling doWork goroutine reach 3s...2009/11/10 23:00:08 Done sleeping! 2009/11/10 23:00:08 doWork exited. 2009/11/10 23:00:08 Done. 2009/11/1

Re: [go-nuts] Understind how to apply timeout using gouritine

2020-02-25 Thread Juan Mamani
Reallly thanks for your help and guide! El martes, 25 de febrero de 2020, 5:45:17 (UTC-3), Michel Levieux escribió: > > Edit: I said "communicate with its caller" but in practice it might as > well be another goroutine or the caller of the caller, either way the > construct and the logic standin

[go-nuts] Re: Converting *byte to unsafe.Pointer and back to *byte

2020-02-25 Thread 'Keith Randall' via golang-nuts
On Tuesday, February 25, 2020 at 4:10:46 AM UTC-8 dmitry@jetbrains.com wrote: > What is the meaning of the conversion > > var b []byte > var p *byte = (*byte)(unsafe.Pointer(*b[0])) > You mean &b[0] at the end there, not *b[0]. > > It is used for example in > https://github.com

[go-nuts] Re: [ANN] Renderview v0.1.0 with go mod, Gio, and Fyne support

2020-02-25 Thread howardcshaw
I worked it out, will update the programs later. It was not that the events were missing - once I enabled the good old Printf debugger, I saw that the events are flowing fine. The issue is that on Linux, every Move Mouse event reflected what buttons were pressed the entire time they were pressed

Re: [go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread Jesper Louis Andersen
On Tue, Feb 25, 2020 at 6:22 PM Jon Conradt wrote: > The Fuchsia Programming Language Policy > > gives > some insight into the experience the Fuchsia team has had with Go, and it > does

Re: [go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread andrey mirtchovski
my take: - c++ programmers are going to c++ program. film at 11 (rob pike had a talk about that) - dart has UI - rust is fashionable, but scary (if you've done rust you'll know why) yes, go was touted as a systems programming language, but it meant "distributed systems". had that been made clear f

[go-nuts] Go 1.14 is released

2020-02-25 Thread Carlos Amedee
Hello gophers, We just released Go 1.14. To find out what has changed in Go 1.14, read the release notes: https://golang.org/doc/go1.14 You can download binary and source distributions from our download page: https://golang.org/dl/ If you have Go installed already, an easy way to try go1.14 is

Re: [go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread Manlio Perillo
And the one that is good at both memory management and concurrency has properties of the language that are not yet well-understood. Manlio On Tuesday, February 25, 2020 at 7:21:00 PM UTC+1, Michael Jones wrote: > > Actually, you should read the whole note -- it's fun. Half of the > languages a

[go-nuts] Re: undefined (type *math/rand.Rand has no field or method randIntn)

2020-02-25 Thread Jake Montgomery
On Tuesday, February 25, 2020 at 1:42:31 PM UTC-5, Anjana Prabhakar wrote: > > I get the error as r1.randIntn undefined (type *math/rand.Rand has no > field or method randIntn). Please help. > The message is pretty clear. The first step I would take with a message like that is to look at the d

Re: [go-nuts] undefined (type *math/rand.Rand has no field or method randIntn)

2020-02-25 Thread burak serdar
On Tue, Feb 25, 2020 at 11:42 AM Anjana Prabhakar wrote: > > Hi All, > > I am trying to generate a random integer using the below code snippet: > package ABC > import ( > * > "math/rand" > ) > func execBlock( > logger log.Logger,) { > var validTxs, invalidTxs, unchkdTxs = 0, 0, 0 > > txIndex :

[go-nuts] undefined (type *math/rand.Rand has no field or method randIntn)

2020-02-25 Thread Anjana Prabhakar
Hi All, I am trying to generate a random integer using the below code snippet: package ABC import ( * "math/rand" ) func execBlock( logger log.Logger,) { var validTxs, invalidTxs, unchkdTxs = 0, 0, 0 txIndex := 0 proxyCb := func(req *xxx, res *yyy) { if r, ok := res.Value.(*); ok { txRes

Re: [go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread Michael Jones
Actually, you should read the whole note -- it's fun. Half of the languages are bad because of memory leaks, the other half are bad because of having GC; half are bad because of difficult asynchronism, the other half are bad because of having a runtime. etc. It reads like an imperiously-worded tau

Re: [go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread Mohamed Yousif
It seems they are betting high on Dart/flutter and their front end is already written with flutter. The assessment seems to be pretty much the same as for Dart. Dart won with the ui side, while go was competing with C. On Tue, 25 Feb 2020 at 7:22 PM, Jon Conradt wrote: > The Fuchsia Programming

[go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread Jon Conradt
The Fuchsia Programming Language Policy gives some insight into the experience the Fuchsia team has had with Go, and it doesn't sound good. "The Fuchsia Platform Source Tree has had n

Re: [go-nuts] Understind how to apply timeout using gouritine

2020-02-25 Thread Jake Montgomery
> > Expected behaviour is to end anonyimous func when 3s timeout is reached. > So what is the problem? The whole thing *does *exit after 3 seconds. Of course, your main() is a loop, so it starts again. 2009/11/10 23:00:00 -Start 2009/11/10 23:00:03 Canceling doWork goroutine

[go-nuts] Converting *byte to unsafe.Pointer and back to *byte

2020-02-25 Thread dmitry.neverov via golang-nuts
What is the meaning of the conversion var b []byte var p *byte = (*byte)(unsafe.Pointer(*b[0])) It is used for example in https://github.com/golang/net/blob/master/internal/socket/iovec_64bit.go. How it is different from var b []byte var p *byte = &b[0] Thank you! -- You rec

Re: [go-nuts] Understind how to apply timeout using gouritine

2020-02-25 Thread Michel Levieux
Edit: I said "communicate with its caller" but in practice it might as well be another goroutine or the caller of the caller, either way the construct and the logic standing behind it are exactly the same :) Le mar. 25 févr. 2020 à 09:42, Michel Levieux a écrit : > Hi Juan, > > You cannot termin

Re: [go-nuts] Understind how to apply timeout using gouritine

2020-02-25 Thread Michel Levieux
Hi Juan, You cannot terminate a function execution from its caller if you did not pass it an argument (most likely a channel) which it can use to communicate with its caller, and terminate itself when the timeout is reached. The simplest example I can think of is the following: https://play.golang