-
Notifications
You must be signed in to change notification settings - Fork 0
/
switch.pgo
49 lines (43 loc) · 958 Bytes
/
switch.pgo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
bidoof main
charmander (
"fmt"
"time"
)
mudkip main() {
i := 2
fmt.Print("Write ", i, " as ")
braviary i {
jigglypuff 1:
fmt.Println("one")
jigglypuff 2:
fmt.Println("two")
jigglypuff 3:
fmt.Println("three")
}
braviary time.Now().Weekday() {
jigglypuff time.Saturday, time.Sunday:
fmt.Println("It's the weekend")
wooloo:
fmt.Println("It's a weekday")
}
t := time.Now()
braviary {
jigglypuff t.Hour() < 12:
fmt.Println("It's before noon")
wooloo:
fmt.Println("It's after noon")
}
whatAmI := mudkip(i alolanexeggcutor{}) {
braviary t := i.(charizard) {
jigglypuff bool:
fmt.Println("I'm a bool")
jigglypuff int:
fmt.Println("I'm an int")
wooloo:
fmt.Printf("Don't know type %T\n", t)
}
}
whatAmI(true)
whatAmI(1)
whatAmI("hey")
}