Damien Neil

Results 262 comments of Damien Neil

These both seem like cases that are better addressed by the place misusing `cmp`. In the case of `k8s.io/kube-openapi`, I don't see why that package is taking a dependency on...

The `cmp` [documentation](https://pkg.go.dev/github.com/google/go-cmp/cmp#pkg-overview) is quite explicit that it's designed for use in tests, and is not suitable for use in production contexts: > It is intended to only be used...

I'd rather wait until the x/ repos update to supporting only 1.18 before doing so here. (They're currently still on 1.17, although 1.17 is out of the supported window so...

And also, while "got" and "want" make sense in tests, `Diff` output isn't necessarily used only in tests. Perhaps there should be a test-specific diff API with named parameters: ```...

#69097 is another example of things going wrong in the current tangle of ReaderFroms/WriterTos. I'm pretty sure this also broke with the addition of *os.File.WriteTo in 1.22.

> In particular we can design the new methods so that they work on the pair of source and destination, which is what we need. I don't follow this. Any...

I'd be fine with adding `httpguts.IsToken`, but the simple interim approach that doesn't require this proposal to be accepted is to add an internal `isToken` function in `net/http`: ``` //...

Another possibility: ``` // Bytes fills p with pseudo-random bytes from the default source. func Bytes(p []byte) // Bytes fills p with pseudo-random bytes. func (*Rand) Bytes(p []byte) ``` Using...

> without Seed, what's the point of having both that and crypto/rand.Read? Sometimes you want some random bytes for non-security purposes, and you don't want to juggle two `rand` packages...

#66988 is related: Adding `*os.File.WriteTo` with a fast path for `sendfile`/`splice` and a fallback to `io.Copy` results in us missing the fast path in `*net.TCPConn.WriteTo`.