all: modernize (#5498)

* modernize string cut usage

* modernize string cut prefix usage

* modernize slices helper usage

* modernize min and max usage

* modernize loop variable copies

* modernize integer range loops

* modernize map copy loops

* modernize go types iterator usage

* modernize empty interface usage

* modernize atomic type usage

* modernize string builders

* modernize string split iteration

* modernize remaining loop variable copies

* modernize usb cdc min usage

* modernize src integer range loops

* modernize example empty interface usage

* modernize src min and max usage

* modernize src integer range loops

* modernize src empty interface usage

* modernize src atomic type usage

* modernize reflect type lookups

* modernize review nits
This commit is contained in:
Jake Bailey
2026-07-06 12:58:48 -07:00
committed by GitHub
parent e569dcfe38
commit 7c3dc05117
54 changed files with 294 additions and 355 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ func main() {
func escapesToHeap() {
n := rand.Intn(100)
println("Doing ", n, " iterations")
for i := 0; i < n; i++ {
for i := range n {
s := make([]byte, i)
_ = append(s, 42)
}
+2 -2
View File
@@ -70,7 +70,7 @@ func main() {
printItf(Number(3))
s := Stringer(thing)
println("Stringer.String():", s.String())
var itf interface{} = s
var itf any = s
println("Stringer.(*Thing).String():", itf.(Stringer).String())
// unusual calls
@@ -124,7 +124,7 @@ func strlen(s string) int {
return len(s)
}
func printItf(val interface{}) {
func printItf(val any) {
switch val := val.(type) {
case Doubler:
println("is Doubler:", val.Double())