[go-nuts] Re: justforfunc: a Go YouTube series

2017-07-10 Thread Szymon Pankalla
Very good job. Thank you. W dniu wtorek, 11 lipca 2017 02:07:25 UTC+2 użytkownik Francesc Campoy Flores napisał: > > Hi gophers, > > Sorry to spam you, but I'll do it only once! Today I published the episode > 15 of a YouTube series >

Re: [go-nuts] Re: genmap: Generate thread-safe, type-safe maps easily

2017-07-10 Thread Олексій Чечель
But it would be the most bloodless way. Go is positioned to develop various APIs and microservices. This is often associated with high loads (in my practice - always). I tired of wrapping the map into structures. Nevertheless, I would like to hear, in occasion of generics, how this would simplify t

[go-nuts] justforfunc: a Go YouTube series

2017-07-10 Thread Francesc Campoy Flores
Hi gophers, Sorry to spam you, but I'll do it only once! Today I published the episode 15 of a YouTube series I've been working on for a while. I think it is becoming a quite good resource for gophers lookin

[go-nuts] Re: go test -S: repeated symbols in assembly

2017-07-10 Thread Francesc Campoy Flores
I can confirm that the behavior only happens on Mac, tried the same on Linux and the output contained each symbol only once. https://github.com/golang/go/issues/20976 On Monday, July 10, 2017 at 3:21:23 PM UTC-7, Francesc Campoy Flores wrote: > > Even using tip I get the same behavior, I attach

[go-nuts] Re: Are functional options idiomatic

2017-07-10 Thread 'Eric Johnson' via golang-nuts
On Sunday, July 9, 2017 at 9:12:06 PM UTC+2, Anmol Sethi wrote: > > Hello everyone! > > I’m writing a new library where I need to be able to configure a struct. > This struct and its configuration will be accessed concurrently. One design > pattern I see throughout the standard library and commu

[go-nuts] Re: Iterate trough interface{} that stores map

2017-07-10 Thread Nathan Kerr
If you know what the map type is, use a type assertion: for k, v := range variable.(map[string]interface{}) { //... } If it could be one of several map types, use a type switch first. If you don't know anything about the map type, I don't know what you think you could do with it because you

[go-nuts] Re: genmap: Generate thread-safe, type-safe maps easily

2017-07-10 Thread ammar
I'm not sure it sets a good precedent adding more data structures to the language. we need generics On Sunday, July 9, 2017 at 10:23:42 PM UTC-5, Олексій Чечель wrote: > > I do not understand what prevents the authors of the language from > determining the thread-safe type *cmap*(name is taken

[go-nuts] Iterate trough interface{} that stores map

2017-07-10 Thread soederboy
How to do that? i recently figure how to iterate interface{} that stores slice but not map using refelct -- 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, send an email to golang-n

Re: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-10 Thread Marvin Renich
* T L [170710 12:35]: > so this is guaranteed by Go memory model? > > package main > > import "fmt" > import "sync/atomic" > import "unsafe" > > func main() { > var x, y int32 > > var p = unsafe.Pointer(&x) > > atomic.AddInt32(&x, 1) > atomic.AddInt32(&y, 1) > >

Re: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-10 Thread Marvin Renich
* T L [170710 12:32]: > so this is guaranteed by go memory model? > > package main > > import "fmt" > import "sync/atomic" > > func main() { > var x, y int32 > > atomic.AddInt32(&x, 1) > atomic.AddInt32(&y, 1) > > if atomic.LoadInt32(&y) == 1 { > fmt.Println("x

Re: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-10 Thread Marvin Renich
[Reply-To set; I don't need two copies of replies.] * T L [170710 12:31]: > so this is guaranteed by Go memory model? > > package main > > import "fmt" > import "sync/atomic" > > func main() { > var x, y int32 > go func() { > atomic.AddInt32(&x, 1) > atomic.AddInt32(&y,

Re: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-10 Thread T L
On Monday, July 10, 2017 at 8:36:54 PM UTC+8, Jan Mercl wrote: > > On Mon, Jul 10, 2017 at 2:24 PM T L > > wrote: > > > Aha, what I wanted to express is the execution orders of the two lines > may be randomized. > > > > atomic.AddInt32(&x, 1) > > atomic.AddInt32(&y, 1) > > No, assuming those

Re: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-10 Thread T L
On Monday, July 10, 2017 at 8:36:54 PM UTC+8, Jan Mercl wrote: > > On Mon, Jul 10, 2017 at 2:24 PM T L > > wrote: > > > Aha, what I wanted to express is the execution orders of the two lines > may be randomized. > > > > atomic.AddInt32(&x, 1) > > atomic.AddInt32(&y, 1) > > No, assuming those

Re: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-10 Thread T L
On Monday, July 10, 2017 at 8:36:54 PM UTC+8, Jan Mercl wrote: > > On Mon, Jul 10, 2017 at 2:24 PM T L > > wrote: > > > Aha, what I wanted to express is the execution orders of the two lines > may be randomized. > > > > atomic.AddInt32(&x, 1) > > atomic.AddInt32(&y, 1) > > No, assuming those

Re: [go-nuts] Re: Random Number Generation in a given range

2017-07-10 Thread alok . singh
yep you are right ! fixed it thanks https://github.com/alok87/goutils/commit/9f5f19a65eedf1bc9be82ec3f3b42c92142b2b8e On Monday, July 10, 2017 at 8:15:13 PM UTC+5:30, Jan Mercl wrote: > > > On Mon, Jul 10, 2017 at 4:41 PM Alok Kumar Singh > wrote: > > > in my usecasei use this to generate rando

[go-nuts] Re: [ANN] gojekyll clone of the Jekyll static site generator

2017-07-10 Thread 'Ingo Oeser' via golang-nuts
You might be interested in https://gohugo.io/overview/introduction/ to get some inspiration or take a peek when you are stuck. On Monday, July 10, 2017 at 3:31:10 AM UTC+2, Oliver Steele wrote: > > Hi everyone, > > As my "learn Go" project, I've been working on a clone of the Jekyll > static sit

Re: [go-nuts] Re: Random Number Generation in a given range

2017-07-10 Thread Jan Mercl
On Mon, Jul 10, 2017 at 4:41 PM Alok Kumar Singh wrote: > in my usecasei use this to generate random slice everytime > dont want the same result > using it to test my algos For that you need one only call to Seed at init(). -- -j -- You received this message because you are subscribed to th

Re: [go-nuts] Re: Random Number Generation in a given range

2017-07-10 Thread Alok Kumar Singh
in my usecasei use this to generate random slice everytime dont want the same result using it to test my algos > On 10-Jul-2017, at 6:46 PM, Sebastien Binet wrote: > > Alok, > >> On Mon, Jul 10, 2017 at 3:04 PM, Alok Kumar Singh >> wrote: >> I have fixed it thanks > > I wouldn't recommend u

Re: [go-nuts] Re: Random Number Generation in a given range

2017-07-10 Thread Sebastien Binet
Alok, On Mon, Jul 10, 2017 at 3:04 PM, Alok Kumar Singh wrote: > I have fixed it thanks > I wouldn't recommend using rand.Seed as you do: this defeats any attempt at getting reproductible results. -s -- You received this message because you are subscribed to the Google Groups "golang-nuts"

[go-nuts] liteide x32.1 released

2017-07-10 Thread visualfc
Hi all. LiteIDE x32.1 released! This version fix x32 bug. The folder custom GOPATH support subfolder inherit parent folder setting. The gocode plugin support custom GOPATH setting. Dlv debugger change to headless mode and fix kill process bug. etc. ### 2017.7.7 Ver X32.1 * LiteIDE * build co

Re: [go-nuts] Re: Random Number Generation in a given range

2017-07-10 Thread Alok Kumar Singh
I have fixed it thanks On Mon, Jul 10, 2017 at 9:54 AM, peterGo wrote: > Alok, > > Your import path "github.com/alok87/goutils/random" is not valid for "go > get". The source is at "github.com/alok87/goutils/pkg/random". > > You write "for { rand.Seed(); rand.Intn(); }". Therefore, the range of

Re: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-10 Thread Jan Mercl
On Mon, Jul 10, 2017 at 2:24 PM T L wrote: > Aha, what I wanted to express is the execution orders of the two lines may be randomized. > > atomic.AddInt32(&x, 1) > atomic.AddInt32(&y, 1) No, assuming those two lines are as written, ie. part of single function and thus executed in a single/the sa

Re: [go-nuts] does Go memory model guarantee this program always prints 1?

2017-07-10 Thread T L
On Sunday, July 9, 2017 at 5:10:20 PM UTC+8, Jan Mercl wrote: > > On Sun, Jul 9, 2017 at 10:56 AM T L > > wrote: > > > But I remember that the "happens-before relationship" is never written > down in any official Go documentation. > > https://golang.org/ref/mem#tmp_2 > > > -- > > -j > Aha, wh