1// +build ignore 2 3package C1 4 5import "strings" 6 7func example() { 8 x := "foo" 9 println(x) 10 11 // Match, but the transformation is not sound w.r.t. possible side effects. 12 println(strings.Repeat("*", 3)) 13 14 // No match, since second use of wildcard doesn't match first. 15 println(strings.Repeat("*", 3)[:len(strings.Repeat("*", 2))]) 16 17 // Recursive match demonstrating bottom-up rewrite: 18 // only after the inner replacement occurs does the outer syntax match. 19 println(x) 20 // -> (x[:len(x)]) 21 // -> x 22} 23