diff --git a/application_structure/main.go b/Section2/application_structure/main.go similarity index 82% rename from application_structure/main.go rename to Section2/application_structure/main.go index 7023b68..fc27e53 100644 --- a/application_structure/main.go +++ b/Section2/application_structure/main.go @@ -1,10 +1,11 @@ package main import "fmt" + const secondsInHour = 3600 func main(){ fmt.Println("Hello Go World!!") - distance := 60.8 //distance in km + distance := 60.8 fmt.Printf("the distance in miles is %f \n", distance * 0.621) -} \ No newline at end of file +} diff --git a/Section3/ex2 b/Section3/ex2 new file mode 100755 index 0000000..53ccd7e Binary files /dev/null and b/Section3/ex2 differ diff --git a/Section3/exercice1.go b/Section3/exercice1.go new file mode 100644 index 0000000..8fabdc2 --- /dev/null +++ b/Section3/exercice1.go @@ -0,0 +1,9 @@ +package main + +import "fmt" + +func main() { + a := 1 + b := 2 + fmt.Println(a, b) +} diff --git a/Section3/exercice2.go b/Section3/exercice2.go new file mode 100644 index 0000000..1a03942 --- /dev/null +++ b/Section3/exercice2.go @@ -0,0 +1,10 @@ +package main + +import "fmt" + +func main() { + a := 1 + b := 2 + c := a + b + fmt.Println("The addition of ", a, " and ", b, " is ", c) +} diff --git a/Section3/exercice6.go b/Section3/exercice6.go new file mode 100644 index 0000000..7215578 --- /dev/null +++ b/Section3/exercice6.go @@ -0,0 +1,13 @@ +package main + +import "fmt" + +func main() { + SayHello() +} +func SayHello() { + fmt.Println("Hello package v1.0.0!") + + var x int = 10 + _ = x +} diff --git a/Section3/my_first_go_app b/Section3/my_first_go_app new file mode 100755 index 0000000..53ccd7e Binary files /dev/null and b/Section3/my_first_go_app differ diff --git a/Section3/my_go_program_mac b/Section3/my_go_program_mac new file mode 100755 index 0000000..81bbebe Binary files /dev/null and b/Section3/my_go_program_mac differ