Re: [go-nuts] Very curious, why is "3:04 PM" named Kitchen in the time package?

2022-09-24 Thread Gregg Townsend
>From the standpoint of my house it should have been called "Nightstand" where the clocks show AM/PM. In my kitchen both the stove and the microwave are just 12-hour clocks with no AM/PM setting nor indicator. On Friday, September 23, 2022 at 2:35:35 AM UTC-7 axel.wa...@googlemail.com wrote: >

Re: [go-nuts] Race detector compatible ring buffer Part II

2022-03-14 Thread Gregg Townsend
Or the same demonstration without a very confusing overloaded identifier (sorry!): https://go.dev/play/p/ChOkAyV8imA?v=gotip On Friday, March 11, 2022 at 8:52:04 AM UTC-7 Gregg Townsend wrote: > Well, the suggested code passes the race detector, but shouldn't it also > be *corr

Re: [go-nuts] Race detector compatible ring buffer Part II

2022-03-11 Thread Gregg Townsend
Well, the suggested code passes the race detector, but shouldn't it also be *correct*? Two concurrent calls of Put can load identical head and tail values and then store in the same slot. See https://go.dev/play/p/gagBCCj2n2g?v=gotip for a demonstration. On Friday, March 11, 2022 at 12:24:42 AM

[go-nuts] Re: Knowing from documentation whether an interface is holding a pointer or a struct?

2021-06-06 Thread Gregg Townsend
On Saturday, June 5, 2021 at 2:15:27 PM UTC-7 Joshua wrote: > However, I see lots of calls of "If you're using pointers to interfaces a > lot, you probably don't understand them". > > Well, what am I not understanding? > To answer this particular point: In most cases (or most cases in actual p

Re: [go-nuts] How to drop old value in a channel salety

2020-11-13 Thread Gregg Townsend
If I understand what you're trying to do, I'd approach it this way, using a generously buffered channel and discarding the extras at the consumer, as shown below, instead of at the producer: result <- c // wait for result to appear for len(c) > 0 { // there is a newer result available re