go source for verification 2026-05-22

This commit is contained in:
2026-05-22 16:44:48 +08:00
commit 3ae432d492
14992 changed files with 3674967 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
// run
package main
import (
"fmt"
"strings"
)
func main() {
defer func() {
err := recover()
txt := fmt.Sprintf("%s", err)
if !strings.HasSuffix(txt, "with length 1") {
panic("bad error: " + txt)
}
}()
foo([]uint64{0})
}
//go:noinline
func foo(haystack []uint64) {
for n := range len(haystack) {
_ = n
_ = haystack[1]
}
xxx := haystack[0:len(haystack)]
sink(xxx)
}
//go:noinline
func sink([]uint64) {}