diff --git a/chapter_01/activity_1.01/main.go b/chapter_01/activity_1.01/main.go index 6db1d0d..0e3a7d1 100644 --- a/chapter_01/activity_1.01/main.go +++ b/chapter_01/activity_1.01/main.go @@ -4,7 +4,6 @@ import ( "fmt" ) - func main() { firstName := "Torsten" @@ -17,4 +16,4 @@ func main() { fmt.Println(age) fmt.Println(peanutAllergy) -} \ No newline at end of file +} diff --git a/chapter_01/exercise_1.01/main.go b/chapter_01/exercise_1.01/main.go index e96dc41..b4fa3a2 100644 --- a/chapter_01/exercise_1.01/main.go +++ b/chapter_01/exercise_1.01/main.go @@ -7,7 +7,6 @@ import ( "time" ) - func main() { rand.Seed(time.Now().UnixNano()) @@ -18,4 +17,4 @@ func main() { fmt.Println(stars) -} \ No newline at end of file +} diff --git a/chapter_01/exercise_1.02/main.go b/chapter_01/exercise_1.02/main.go index 63f5fcc..1c58609 100644 --- a/chapter_01/exercise_1.02/main.go +++ b/chapter_01/exercise_1.02/main.go @@ -2,10 +2,8 @@ package main import "fmt" - var foo string = "bar" - func main() { var baz string = "qux" diff --git a/chapter_01/exercise_1.03/main.go b/chapter_01/exercise_1.03/main.go index 2d2c616..57f6700 100644 --- a/chapter_01/exercise_1.03/main.go +++ b/chapter_01/exercise_1.03/main.go @@ -5,16 +5,14 @@ import ( "time" ) - var ( - Debug bool = false - LogLevel string = "info" + Debug bool = false + LogLevel string = "info" startUpTime time.Time = time.Now() ) - -func main () { +func main() { fmt.Println(Debug, LogLevel, startUpTime) -} \ No newline at end of file +} diff --git a/chapter_01/exercise_1.04/main.go b/chapter_01/exercise_1.04/main.go index 35f4cb3..9abb5ed 100644 --- a/chapter_01/exercise_1.04/main.go +++ b/chapter_01/exercise_1.04/main.go @@ -5,14 +5,12 @@ import ( "time" ) - var ( - Debug bool - LogLevel = "info" + Debug bool + LogLevel = "info" startUpTime = time.Now() ) - func main() { fmt.Println(Debug, LogLevel, startUpTime) diff --git a/chapter_01/exercise_1.05/main.go b/chapter_01/exercise_1.05/main.go index 7fe499e..c78d832 100644 --- a/chapter_01/exercise_1.05/main.go +++ b/chapter_01/exercise_1.05/main.go @@ -5,7 +5,6 @@ import ( "time" ) - func main() { Debug := false @@ -14,4 +13,4 @@ func main() { fmt.Println(Debug, LogLevel, startUpTime) -} \ No newline at end of file +} diff --git a/chapter_01/exercise_1.06/main.go b/chapter_01/exercise_1.06/main.go index 3957e03..df4947d 100644 --- a/chapter_01/exercise_1.06/main.go +++ b/chapter_01/exercise_1.06/main.go @@ -5,14 +5,12 @@ import ( "time" ) - func getConfig() (bool, string, time.Time) { return false, "info", time.Now() } - func main() { Debug, LogLevel, startUpTime := getConfig() diff --git a/chapter_01/exercise_1.07/main.go b/chapter_01/exercise_1.07/main.go index 6f21398..ef18356 100644 --- a/chapter_01/exercise_1.07/main.go +++ b/chapter_01/exercise_1.07/main.go @@ -2,10 +2,8 @@ package main import "fmt" - var defaultOffset = 10 - func main() { offset := 5 @@ -16,4 +14,4 @@ func main() { offset = offset + defaultOffset fmt.Println(offset) -} \ No newline at end of file +} diff --git a/chapter_01/exercise_1.08/main.go b/chapter_01/exercise_1.08/main.go index 6984439..a9c59c3 100644 --- a/chapter_01/exercise_1.08/main.go +++ b/chapter_01/exercise_1.08/main.go @@ -2,11 +2,10 @@ package main import "fmt" - func main() { query, limit, offset := "bat", 10, 0 query, limit, offset = "ball", offset, 20 fmt.Println(query, limit, offset) -} \ No newline at end of file +} diff --git a/chapter_01/exercise_1.09/main.go b/chapter_01/exercise_1.09/main.go index 969bb17..51ec206 100644 --- a/chapter_01/exercise_1.09/main.go +++ b/chapter_01/exercise_1.09/main.go @@ -2,7 +2,6 @@ package main import "fmt" - func main() { // Main course @@ -36,4 +35,4 @@ func main() { fmt.Println("With this visit, you've earned a reward.") } -} \ No newline at end of file +} diff --git a/chapter_01/exercise_1.10/main.go b/chapter_01/exercise_1.10/main.go index 4779738..ccba86a 100644 --- a/chapter_01/exercise_1.10/main.go +++ b/chapter_01/exercise_1.10/main.go @@ -2,7 +2,6 @@ package main import "fmt" - func main() { count := 5 @@ -19,4 +18,4 @@ func main() { name += " Smith" fmt.Println(name) -} \ No newline at end of file +} diff --git a/chapter_01/exercise_1.11/main.go b/chapter_01/exercise_1.11/main.go index 7147898..65d8a37 100644 --- a/chapter_01/exercise_1.11/main.go +++ b/chapter_01/exercise_1.11/main.go @@ -2,7 +2,6 @@ package main import "fmt" - func main() { visits := 15 @@ -12,4 +11,4 @@ func main() { fmt.Println("Gold member :", visits > 20 && visits <= 30) fmt.Println("Platinum member:", visits > 30) -} \ No newline at end of file +} diff --git a/chapter_01/exercise_1.12/main.go b/chapter_01/exercise_1.12/main.go index 6c80272..0d304c4 100644 --- a/chapter_01/exercise_1.12/main.go +++ b/chapter_01/exercise_1.12/main.go @@ -5,7 +5,6 @@ import ( "time" ) - func main() { var count int @@ -26,4 +25,4 @@ func main() { var startTime time.Time fmt.Printf("Start: %#v \n", startTime) -} \ No newline at end of file +} diff --git a/chapter_01/exercise_1.13/main.go b/chapter_01/exercise_1.13/main.go index 5d5f36a..77fca82 100644 --- a/chapter_01/exercise_1.13/main.go +++ b/chapter_01/exercise_1.13/main.go @@ -5,12 +5,11 @@ import ( "time" ) - func main() { var count1 *int count2 := new(int) - countTemp :=5 + countTemp := 5 count3 := &countTemp t := &time.Time{} @@ -19,4 +18,4 @@ func main() { fmt.Printf("count3: %#v\n", count3) fmt.Printf("time : %#v\n", t) -} \ No newline at end of file +} diff --git a/test/main.go b/test/main.go index c5b35a1..c47c63f 100644 --- a/test/main.go +++ b/test/main.go @@ -1,7 +1,9 @@ package main + import ( "fmt" ) + func main() { fmt.Println("This is a test") -} \ No newline at end of file +}