News for hackers. Stuff that matters.
Re:The Go Programming Language, or: Why all C-like languages... by supersillyus on Wednesday June 08, 2011 @01:57PM (#2634216)
When you say "switch <value>", it matches the "case" statements based on if the value after "case" is equal to <value>. So, if you say

    const P = 3.141
    switch 3.141 {
       case P: 
          fmt.Println("This prints") 
    }
When no value is specified after "switch", the value of "true" is implied, which is why you can do:

    switch {
       case a && b: ..
       case something():
    }

There are no comments on this comment yet.