Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go: fix recent regression (broken
intToStr
)
This partially reverts commit 7be4a2b. The above mentioned commit introduced a bug when converting `strconv.FormatInt(int64(v), 10)` to `strconv.Itoa(int64(v))` (it should have been `strconv.Itoa(v)`, because https://pkg.go.dev/strconv#Itoa accepts `int`, not `int64`). Therefore, apparently all tests using `intToStr` were broken since then. However, I don't think the change to `strconv.Itoa` was necessary. The documentation of [`strconv.Itoa`](https://pkg.go.dev/strconv#Itoa) explains that it is equivalent to `strconv.Itoa(int64(v))`, and it is apparently also implemented that way: https://cs.opensource.google/go/go/+/refs/tags/go1.22.5:src/strconv/itoa.go;l=34 `strconv.FormatInt` has the potential advantage that it accepts the widest possible integer type `int64`, not `int` which might be only 32 bits wide. `strconv.Itoa` seems to be just a convenience alias with a less general argument type.
- Loading branch information