Skip to content

Commit f5886b5

Browse files
author
Ashwin Hegde
committed
Merge pull request #1 from hegdeashwin/chapters
Adds types egs
2 parents c7f92b3 + f0d36c0 commit f5886b5

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

ch1/booleans.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+
fmt.Println(true && true)
7+
fmt.Println(true && false)
8+
fmt.Println(true || true)
9+
fmt.Println(true || false)
10+
fmt.Println(!true)
11+
12+
fmt.Println((true && false) || (false && true) || !(false && false))
13+
}

ch1/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
fmt.Println("Hello World")
7+
}

ch1/numbers.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
fmt.Println("1 + 1 = ", 1 + 1)
7+
fmt.Println("1.0 + 1.0 = ", 1.0 + 1.0)
8+
}

ch1/strings.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package main
2+
3+
import "fmt"
4+
5+
func main() {
6+
fmt.Println(len("Ashwin Hegde"))
7+
fmt.Println("Ashwin Hegde"[1])
8+
fmt.Println("Ashwin " + "Hegde")
9+
10+
// fmt.Println("Ashwin" + 45)
11+
// fmt.Println("45" + 45)
12+
13+
// fmt.Println(5 + 5 + 5)
14+
// fmt.Println("5" + 5 + 5)
15+
// fmt.Println(5 + "5" + 5)
16+
// fmt.Println(5 + 5 + "5")
17+
}

0 commit comments

Comments
 (0)