Hi, everyone! Thank you for reading. I wanted to share a pet project I
started a few weeks ago in my free time, it's a wrapper around sync.Pool
that has limited set of online statistics about the memory cost
(arbitrarily defined by the user) for two reasons: (1) to know whether it
wants it or n
Hi! I wanted to ask what is the difference between the current
implementation of math.Abs and the following:
```go
func Abs(x float64) float64 {
if x < 0 {
return -x
}
return x
}
```
math.Abs would appear to return a copy of the input with the sign bit set
to zero. I tried the
Hi everyone! I wanted to ask about the error in the title: "cannot use a
type parameter as RHS in type declaration".
My use case: I am implementing range queries on a single dimension, and use
a common type, e.g. int64. There is a method that I have to implement that
is Contains(v int64) bool.
:]) // no need to keep a reference to the string Key
as = as[:write]
return Value{num: uint64(len(as)), any: groupptr(unsage.SliceData(as))}
}
On Monday, 14 August 2023 at 22:06:57 UTC-3 Diego Augusto Molina wrote:
> Hello everyone, thank you for reading. I'm looking at the
Hello everyone, thank you for reading. I'm looking at the code of
slog.GroupValue
(https://cs.opensource.google/go/go/+/refs/tags/go1.21.0:src/log/slog/value.go;l=171)
and was wondering if we could benefit from reusing the same slice like this:
// GroupValue returns a new Value for a list of
Thank you very much, that's actually what I was looking for.
On Monday, 14 August 2023 at 13:57:35 UTC-3 Axel Wagner wrote:
> You might be interested in https://github.com/golang/go/issues/61372
>
> On Mon, Aug 14, 2023 at 3:52 PM Diego Augusto Molina <
> diegoaugu...@gmail
Hi, thank you for reading. Whenever I need to use a zero value for a
generic type in a func I do something like the following:
func SetZero[T any](pt *T) T {
var zeroT T
*pt = zeroT
}
That's all good, but I wonder how, if possible, it could be proved to the
compiler that zeroT is the
nelErr
== target" it had done something like "errors.Is(target, sentinelErr)".
This is evidently an internal issue, not with the standard library, sorry
about the fuzz.
On Monday, 31 July 2023 at 17:22:11 UTC-3 Diego Augusto Molina wrote:
> Hello everyone. In relation to standa
Hello everyone. In relation to standard errors package, I wanted to ask
about safe ways of implementing Is(target error) bool. The current
documentation
(https://cs.opensource.google/go/go/+/refs/tags/go1.20.6:src/errors/wrap.go;l=35)
says the following:
// An error type might provide an Is m
>From times to times I write a scraper or some other tool that would
authenticate to a service and then use the auth result to do stuff
concurrently. But when auth expires, I need to synchronize all my
goroutines and have a single one do the re-auth process, check the status,
etc. and then arra
Hi, I think I spotted a small typo in the draft. In Examples >
Containers we have:
// Find returns the value associated with a key, or zero if not present.
// The bool result reports whether the key was found.
func (m *Map(K, V)) Find(k K) (V, bool) {
pn := m.find(k)
if *pn == nil
Very often I use the stringer command to generate lists of enumerated
values, which is great btw.
But one thing that I see myself also writing after this is a Parse method
or function to validate strings that are received.
The use case is that I have a list of possible values for a controlled
fi
12 matches
Mail list logo