Re: [go-nuts] golan operator

2020-08-02 Thread Kurtis Rader
On Sun, Aug 2, 2020 at 9:56 PM Anjana Prabhakar wrote: > Dear All, > > Can someone help me understand the syntax > >> a <- b >> b := <-a > > The "<-" operator is the channel receive operator. See https://golang.org/ref/spec#Channel_types and https://golang.org/ref/spec#Receive_operator. Those

[go-nuts] golan operator

2020-08-02 Thread Anjana Prabhakar
Dear All, Can someone help me understand the syntax > a <- b > b := <-a Thanks for the help. Regards, Anjana -- 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

[go-nuts] Re: Is there a gui library for Go, like Gtk+ or similar, which can be used to build statically linked executables ?

2020-08-02 Thread ma...@eliasnaur.com
On Sunday, 2 August 2020 at 23:24:20 UTC+2 jake...@gmail.com wrote: > There is currently no 'clear choice' for GUI in go. It will depend on you > needs. Some to look into: > > https://bitbucket.org/rj/goey/src/master/ > https://gioui.org/ > https://github.com/andlabs/ui >

[go-nuts] Re: Is there a gui library for Go, like Gtk+ or similar, which can be used to build statically linked executables ?

2020-08-02 Thread Serge Hulne
Fantastic! I'll have a great time trying them out! Thanks! On Sunday, 2 August 2020 23:24:20 UTC+2, jake...@gmail.com wrote: > > There is currently no 'clear choice' for GUI in go. It will depend on you > needs. Some to look into: > > https://bitbucket.org/rj/goey/src/master/ >

[go-nuts] Re: Is there a gui library for Go, like Gtk+ or similar, which can be used to build statically linked executables ?

2020-08-02 Thread Serge Hulne
Thanks! On Sunday, 2 August 2020 23:09:45 UTC+2, smart dev wrote: > > Yes, you can use go-astilectron. (electron + go) > https://github.com/asticode/go-astilectron > > On Sunday, August 2, 2020 at 9:53:32 AM UTC-6, Serge Hulne wrote: >> >> Is there a gui library for Go, like Gtk+ or similar,

[go-nuts] Re: Is there a gui library for Go, like Gtk+ or similar, which can be used to build statically linked executables ?

2020-08-02 Thread jake...@gmail.com
There is currently no 'clear choice' for GUI in go. It will depend on you needs. Some to look into: https://bitbucket.org/rj/goey/src/master/ https://gioui.org/ https://github.com/andlabs/ui https://github.com/goki/gi https://github.com/lxn/walk On Sunday, August 2, 2020 at 11:53:32 AM UTC-4

Re: [go-nuts] Newbie question about type-casts

2020-08-02 Thread Kurtis Rader
In addition to Jake's question regarding whether you want to round up or down I'll point out there isn't any to cast to float64 and back to int64. If you want to "round down" just divide by four. If you want to "round up" add one less than the divisor before dividing; e.g., bet := (cash + 3) / 4.

[go-nuts] Re: Newbie question about type-casts

2020-08-02 Thread jake...@gmail.com
There is probably a better way, but lets start with a clear definition of the problem. Your post says you want to "round *down*" but the variable 'bet' is the result of a divide by 4, rounded *up*. Which do you actually want to do? On Sunday, August 2, 2020 at 5:09:45 PM UTC-4

[go-nuts] Re: Is there a gui library for Go, like Gtk+ or similar, which can be used to build statically linked executables ?

2020-08-02 Thread smart dev
Yes, you can use go-astilectron. (electron + go) https://github.com/asticode/go-astilectron On Sunday, August 2, 2020 at 9:53:32 AM UTC-6, Serge Hulne wrote: > > Is there a gui library for Go, like Gtk+ or similar, which will produce a > statically linked executable ? > > The aim is to create

[go-nuts] Newbie question about type-casts

2020-08-02 Thread Martin Møller Skarbiniks Pedersen
I have written my first little piece of Go-code. However it took some time and code for me to divide a int64 by 4 and round down. How can the last two lines be rewritten? Regards Martin package main import ( "fmt" "bufio" "math" ) var cash int64 scanner := bufio.NewScanner(os.Stdin)

Re: [go-nuts] Type parameters on another line

2020-08-02 Thread Jose Luis Vazquez
Thanks! I see your point. I guess that is the main reason the type parameters mapping needs to be in the same declaration line. Still, for generic types it is ok, but for generic functions it feels a bit too much stuff crammed into the signature line. Thanks again for explaining! Jose El

[go-nuts] Is there a gui library for Go, like Gtk+ or similar, which can be used to build statically linked executables ?

2020-08-02 Thread Serge Hulne
Is there a gui library for Go, like Gtk+ or similar, which will produce a statically linked executable ? The aim is to create apps which do not require the user to install GTK or any extra libraries in order to use the app. -- You received this message because you are subscribed to the

Re: [go-nuts] Re: Why we don't have simple throws error statement

2020-08-02 Thread Denis Cheremisov
There are two major issues with Go error handling: 1. It is not strict enough, i.e. the compiler cannot ensure error check 2. It is not consistent enough. In the first you can easily ignore an error and the compiler will let you go further. In the second, you can both *if err :=