Go Daily Tips
Thursday, January 15, 2015
Multiple switch cases
Switch cases can be separated by coma:
func shouldEscape(c byte) bool {
switch c {
case ' ', '?', '&', '=', '#', '+', '%':
return true
}
return false
}
No comments:
Post a Comment
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment