Skip to content

Commit 73bd5ed

Browse files
committed
test if
test if
1 parent 2f96e98 commit 73bd5ed

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

hacking-go/learn04/for/incdec.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
7+
// var sum int
8+
sum, i := 0, 0
9+
// This will not work
10+
sum = i++
11+
12+
fmt.Println(sum)
13+
}

hacking-go/learn04/if/if.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
a := 20
7+
b := 20
8+
9+
if b > a {
10+
11+
fmt.Println(b, ">", a)
12+
}
13+
if b < a {
14+
fmt.Println(b, "<", a)
15+
}
16+
if b == a {
17+
fmt.Println(b, "=", a)
18+
}
19+
}

0 commit comments

Comments
 (0)