Scope trickiness in Go
Go scope is different for for loops and if blocks than in Python For example, with some code, package main import ( "fmt" "slices" ) func main() { var stuff = []string{ "foo", "bar", "hmm", } if idx := slices.IndexFunc(stuff, func(x string) bool { return x == "foo" }); idx == -1 { fmt.Println("yes") found := true } else { fmt.Println("no") found := false } fmt.Printf("found %v\n", found) } But the error is...