[go-nuts] go/version, "go2.00.1" < "go1.0.0"

2024-02-26 Thread leo zeng
package main import "go/version" func main() { var val int val = version.Compare("go2.00.1", "go1.0.0") print(val) // -1 } -- 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

[go-nuts] Re: Logging libraries and standard library compatibility

2021-08-30 Thread Leo Baltus
Maybe it is worth checking out: https://github.com/go-logr/logr On Sunday, August 29, 2021 at 8:10:54 AM UTC+2 Amnon wrote: > Yes, this is a massive pain. > > The standard library's log.Logger is not an interface, despite ending in > er. > > If it was an interface, it would be easy for third p

Re: [go-nuts] Re: How to make the first character in a string lowercase?

2020-06-18 Thread leo
package main import ( "fmt" "unicode" ) func main() { fmt.Println(MakeFirstLowerCase("LikeThis")) } func MakeFirstLowerCase(s string) string { if len(s)==0 { return s } r := []rune(s) r[0] = unicode.ToLower(r[0]) return string(r) } On Thu, Jun 18, 2020 at 10:38 AM

[go-nuts] Memory synchronization by channel operations and mutexes

2020-06-15 Thread Leo Baltus
le to goroutines running on other processors. I would like to better understand how this works. What is it that makes this ‘flush out’ to happen? Is this a system call? — Leo -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

[go-nuts] Where to find documentation for old Golang releases

2019-09-18 Thread Leo R
versions of Go Language Specification and Standard Library documentation? Thanks, --Leo -- 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-nut

Re: [go-nuts] An old problem: lack of priority select cases

2019-09-04 Thread Leo Lara
> need the lock on the readers) > > On Sep 4, 2019, at 4:55 AM, Leo Lara wrote: > > > > You should read up on how a RWLock works. >> > > I am not going to answer to that ;-) > > About this code: > > https://play.golang.org/p/YOwuYFiqtlf > > 1. I wouldn&

Re: [go-nuts] Re: An old problem: lack of priority select cases

2019-09-04 Thread Leo Lara
wikipedia.org/wiki/White_box_(software_engineering)> or open system <https://en.wikipedia.org/wiki/Open_system_(computing)>)"""" On Saturday, August 31, 2019 at 10:53:26 AM UTC+2, Jesper Louis Andersen wrote: > > On Thu, Aug 29, 2019 at 7:02 AM Leo Lara

Re: [go-nuts] An old problem: lack of priority select cases

2019-09-04 Thread Leo Lara
fact, others can be late started, as >>>>>>> they >>>>>>> will fail fast if the channel is already closed. >>>>>>> >>>>>> >>>>>> https://play.golang.org/p/pcwIu2w8ZRb >>>>>> >>&g

Re: [go-nuts] An old problem: lack of priority select cases

2019-09-04 Thread Leo Lara
efore the desired number of iterations. > > On Aug 29, 2019, at 12:13 AM, Leo Lara > wrote: > > Hi Robert, > > To put you in context, it all started when I read > https://go101.org/article/channel-closing.html , that said that it is > impossible or at least you shouldn

Re: [go-nuts] Re: An old problem: lack of priority select cases

2019-09-04 Thread Leo Lara
haring a channel and closing it > safely upon receiving an exit flag: > https://play.golang.org/p/RiKi1PGVSvF > > -- Marcin > > On Wed, Aug 28, 2019 at 11:29 AM Leo Lara > wrote: > >> I do not think priority select is *necessary*, it could be a nice >> addition i

Re: [go-nuts] An old problem: lack of priority select cases

2019-08-28 Thread Leo Lara
model for this, you want a thread safe flag of some sort. For example: >> >> var exitFlag uint64 >> func producer(chan data int, wg *sync.WaitGroup) { >> defer wg.Done() >> for { >> shouldExit := atomic.LoadUint64(&exitFlag) >> if shouldExit =

Re: [go-nuts] Re: An old problem: lack of priority select cases

2019-08-28 Thread Leo Lara
r(chan data int, wg *sync.WaitGroup) { >> defer wg.Done() >> for { >> shouldExit := atomic.LoadUint64(&exitFlag) >> if shouldExit == 1 { >> return >> } >> chan <- rand.Intn(100) >> } >>

Re: [go-nuts] Re: An old problem: lack of priority select cases

2019-08-28 Thread Leo Lara
I do not think priority select is *necessary*, it could be a nice addition if the performance does not change. On Wednesday, August 28, 2019 at 8:27:36 PM UTC+2, Leo Lara wrote: > > Hi Robert, > > From the article: """To bound more the problem, in my case, you control

Re: [go-nuts] Re: An old problem: lack of priority select cases

2019-08-28 Thread Leo Lara
ncapsulate it all in a MultiWriterChannel struct - generics would > help here :) > > -Original Message- > From: Leo Lara > Sent: Aug 28, 2019 11:24 AM > To: golang-nuts > Subject: [go-nuts] Re: An old problem: lack of priority select cases > > This is connected

[go-nuts] Re: An old problem: lack of priority select cases

2019-08-28 Thread Leo Lara
This is connected with my article: https://dev.to/leolara/closing-a-go-channel-written-by-several-goroutines-52j2 I think there I show it is possible to workaround that limitation using standard Go tools. Of course, the code would be simple with priority select, but also perhaps select would be

Re: [go-nuts] time.Format vs. fmt.Sprintf

2019-07-23 Thread Leo R
Dan is the only one in this thread who pays attention to the actual value of the timestamp not just to its format :-) --Leo On Tuesday, July 23, 2019 at 7:45:37 PM UTC-4, Robert Engels wrote: > > Funny. Did you remember it or just pay close attention to these things? > > > On J

[go-nuts] Re: Need help to learn go lang

2019-07-20 Thread Leo R
iliarity with programming in general. Hope it helps, --Leo On Friday, July 19, 2019 at 9:39:03 AM UTC-4, veeres...@gmail.com wrote: > > would anyone help me out how to learn go lang more practically , may be > some resources . I want to understand go lang more practically , with some > g

Re: [go-nuts] Re: Go for Data Science

2019-07-16 Thread Leo R
a sad possibility. gonum is a very interesting project which plays in the same space as numpy. But is there anything that can replace pandas in the Go-universe? --Leo On Tuesday, July 16, 2019 at 6:29:50 PM UTC-4, kortschak wrote: > > We'd (gonum-dev) likely advise not to use julia

Re: [go-nuts] Go for Data Science

2019-07-16 Thread Leo R
zoo. Language barriers in scientifically heavy fields are not healthy. In Statistics, Python's stats.models is a pale shadow of R's CRAN. Science community is split along the language lines that spreads already thin resources even further. --Leo On Tuesday, July 16, 2019 at 4:45:3

Re: [go-nuts] Go for Data Science

2019-07-16 Thread Leo R
ng or will leave the field to other players. --Leo On Tuesday, July 16, 2019 at 3:31:12 PM UTC-4, Michael Jones wrote: > > Leo, > > R is implemented in C and FORTRAN plus R on top of that. SAS is in C (and > some Go here and there) plus the SAS language in top of that. Mathematica

[go-nuts] Re: How to lowercase all field names for MarshalJSON and UnmarshalJSON?

2019-03-15 Thread leo
Me too I have to add struct tags to over 300 objects, repeating the same text in a different style, totally unproductive and annoying work which the computer should do for me. In the end I've used a tool that parses the .go files and adds the tags automatically, although that resulted in dozens