use constants

This commit is contained in:
Mark McGranaghan 2012-10-15 11:16:46 -07:00
parent 252f7d77ac
commit ec9a7d4d4b

View File

@ -23,8 +23,8 @@ func main() {
// You can use commas to separate multiple expressions
// in the same `case` statement. We use the optional
// `default` case in this example as well.
switch time.Now().Weekday().String() {
case "Saturday", "Sunday":
switch time.Now().Weekday() {
case time.Saturday, time.Sunday:
fmt.Println("It's the weekend")
default:
fmt.Println("It's a weekday")