Browse Source

Small reformatting to make linter happy

T. Meissner 1 week ago
parent
commit
1f8d7f9183

+ 1
- 2
chapter_01/activity_1.01/main.go View File

@@ -4,7 +4,6 @@ import (
4 4
   "fmt"
5 5
 )
6 6
 
7
-
8 7
 func main() {
9 8
 
10 9
   firstName := "Torsten"
@@ -17,4 +16,4 @@ func main() {
17 16
   fmt.Println(age)
18 17
   fmt.Println(peanutAllergy)
19 18
 
20
-}
19
+}

+ 1
- 2
chapter_01/exercise_1.01/main.go View File

@@ -7,7 +7,6 @@ import (
7 7
   "time"
8 8
 )
9 9
 
10
-
11 10
 func main() {
12 11
 
13 12
   rand.Seed(time.Now().UnixNano())
@@ -18,4 +17,4 @@ func main() {
18 17
 
19 18
   fmt.Println(stars)
20 19
 
21
-}
20
+}

+ 0
- 2
chapter_01/exercise_1.02/main.go View File

@@ -2,10 +2,8 @@ package main
2 2
 
3 3
 import "fmt"
4 4
 
5
-
6 5
 var foo string = "bar"
7 6
 
8
-
9 7
 func main() {
10 8
 
11 9
   var baz string = "qux"

+ 4
- 6
chapter_01/exercise_1.03/main.go View File

@@ -5,16 +5,14 @@ import (
5 5
   "time"
6 6
 )
7 7
 
8
-
9 8
 var (
10
-  Debug bool = false
11
-  LogLevel string = "info"
9
+  Debug       bool      = false
10
+  LogLevel    string    = "info"
12 11
   startUpTime time.Time = time.Now()
13 12
 )
14 13
 
15
-
16
-func main () {
14
+func main() {
17 15
 
18 16
   fmt.Println(Debug, LogLevel, startUpTime)
19 17
 
20
-}
18
+}

+ 2
- 4
chapter_01/exercise_1.04/main.go View File

@@ -5,14 +5,12 @@ import (
5 5
   "time"
6 6
 )
7 7
 
8
-
9 8
 var (
10
-  Debug bool
11
-  LogLevel = "info"
9
+  Debug       bool
10
+  LogLevel    = "info"
12 11
   startUpTime = time.Now()
13 12
 )
14 13
 
15
-
16 14
 func main() {
17 15
 
18 16
   fmt.Println(Debug, LogLevel, startUpTime)

+ 1
- 2
chapter_01/exercise_1.05/main.go View File

@@ -5,7 +5,6 @@ import (
5 5
   "time"
6 6
 )
7 7
 
8
-
9 8
 func main() {
10 9
 
11 10
   Debug := false
@@ -14,4 +13,4 @@ func main() {
14 13
 
15 14
   fmt.Println(Debug, LogLevel, startUpTime)
16 15
 
17
-}
16
+}

+ 0
- 2
chapter_01/exercise_1.06/main.go View File

@@ -5,14 +5,12 @@ import (
5 5
   "time"
6 6
 )
7 7
 
8
-
9 8
 func getConfig() (bool, string, time.Time) {
10 9
 
11 10
   return false, "info", time.Now()
12 11
 
13 12
 }
14 13
 
15
-
16 14
 func main() {
17 15
 
18 16
   Debug, LogLevel, startUpTime := getConfig()

+ 1
- 3
chapter_01/exercise_1.07/main.go View File

@@ -2,10 +2,8 @@ package main
2 2
 
3 3
 import "fmt"
4 4
 
5
-
6 5
 var defaultOffset = 10
7 6
 
8
-
9 7
 func main() {
10 8
 
11 9
   offset := 5
@@ -16,4 +14,4 @@ func main() {
16 14
   offset = offset + defaultOffset
17 15
   fmt.Println(offset)
18 16
 
19
-}
17
+}

+ 1
- 2
chapter_01/exercise_1.08/main.go View File

@@ -2,11 +2,10 @@ package main
2 2
 
3 3
 import "fmt"
4 4
 
5
-
6 5
 func main() {
7 6
 
8 7
   query, limit, offset := "bat", 10, 0
9 8
   query, limit, offset = "ball", offset, 20
10 9
   fmt.Println(query, limit, offset)
11 10
 
12
-}
11
+}

+ 1
- 2
chapter_01/exercise_1.09/main.go View File

@@ -2,7 +2,6 @@ package main
2 2
 
3 3
 import "fmt"
4 4
 
5
-
6 5
 func main() {
7 6
 
8 7
   // Main course
@@ -36,4 +35,4 @@ func main() {
36 35
     fmt.Println("With this visit, you've earned a reward.")
37 36
   }
38 37
 
39
-}
38
+}

+ 1
- 2
chapter_01/exercise_1.10/main.go View File

@@ -2,7 +2,6 @@ package main
2 2
 
3 3
 import "fmt"
4 4
 
5
-
6 5
 func main() {
7 6
 
8 7
   count := 5
@@ -19,4 +18,4 @@ func main() {
19 18
   name += " Smith"
20 19
   fmt.Println(name)
21 20
 
22
-}
21
+}

+ 1
- 2
chapter_01/exercise_1.11/main.go View File

@@ -2,7 +2,6 @@ package main
2 2
 
3 3
 import "fmt"
4 4
 
5
-
6 5
 func main() {
7 6
 
8 7
   visits := 15
@@ -12,4 +11,4 @@ func main() {
12 11
   fmt.Println("Gold member    :", visits > 20 && visits <= 30)
13 12
   fmt.Println("Platinum member:", visits > 30)
14 13
 
15
-}
14
+}

+ 1
- 2
chapter_01/exercise_1.12/main.go View File

@@ -5,7 +5,6 @@ import (
5 5
   "time"
6 6
 )
7 7
 
8
-
9 8
 func main() {
10 9
 
11 10
   var count int
@@ -26,4 +25,4 @@ func main() {
26 25
   var startTime time.Time
27 26
   fmt.Printf("Start: %#v \n", startTime)
28 27
 
29
-}
28
+}

+ 2
- 3
chapter_01/exercise_1.13/main.go View File

@@ -5,12 +5,11 @@ import (
5 5
   "time"
6 6
 )
7 7
 
8
-
9 8
 func main() {
10 9
 
11 10
   var count1 *int
12 11
   count2 := new(int)
13
-  countTemp :=5
12
+  countTemp := 5
14 13
   count3 := &countTemp
15 14
   t := &time.Time{}
16 15
 
@@ -19,4 +18,4 @@ func main() {
19 18
   fmt.Printf("count3: %#v\n", count3)
20 19
   fmt.Printf("time  : %#v\n", t)
21 20
 
22
-}
21
+}

+ 3
- 1
test/main.go View File

@@ -1,7 +1,9 @@
1 1
 package main
2
+
2 3
 import (
3 4
   "fmt"
4 5
 )
6
+
5 7
 func main() {
6 8
   fmt.Println("This is a test")
7
-}
9
+}