github.com/traefik/yaegi@v0.15.1/_test/switch38.go (about) 1 package main 2 3 func isSeparator(c byte) bool { 4 switch c { 5 case '(', ')', '<', '>', '@', ',', ';', ':', '\\', '"', '/', '[', ']', '?', '=', '{', '}', ' ', '\t': 6 return true 7 } 8 return false 9 } 10 11 func main() { 12 s := "max-age=20" 13 for _, c := range []byte(s) { 14 println(string(c), isSeparator(c)) 15 } 16 } 17 18 // Output: 19 // m false 20 // a false 21 // x false 22 // - false 23 // a false 24 // g false 25 // e false 26 // = true 27 // 2 false 28 // 0 false