From ec9a7d4d4beb48b9db183bef9347624d8c34684b Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Mon, 15 Oct 2012 11:16:46 -0700 Subject: [PATCH] use constants --- examples/switch/switch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/switch/switch.go b/examples/switch/switch.go index 7af3156..54c74c1 100644 --- a/examples/switch/switch.go +++ b/examples/switch/switch.go @@ -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")