@@ -6,14 +6,14 @@ Go-Programmierung für Java-Entwickler
6
6
7
7
* Fabian Stäber, ConSol Software GmbH
8
8
* Java Developer, Gopher
9
- * Some Go projects on GitHub, like github.com/fstab/grok_exporter
9
+ * Some Go projects on GitHub, like [ github.com/fstab/grok_exporter] ( https://github.com/fstab/grok_exporter )
10
10
11
11
2 Resources
12
12
-----------
13
13
14
- * https://tour.golang.org
15
- * Alan A. A. Donovan, Brian W. Kernighan: _ The Go Programming Language_ , Addison-Wesley, 2015
16
- * Google for 'golang'
14
+ * ** Online tutorial: ** https://tour.golang.org
15
+ * ** Book: ** Alan A. A. Donovan, Brian W. Kernighan: _ The Go Programming Language_ , Addison-Wesley, 2015
16
+ * ** Help: ** Google keyword for the Go programming language is 'golang'
17
17
18
18
3 About Go
19
19
----------
@@ -70,9 +70,9 @@ go help fmt
70
70
The ` go ` command is more like ` mvn ` than like ` javac ` .
71
71
72
72
```
73
- go get ...
74
- go test ...
75
- go install ...
73
+ go get ... <-- download from github, bitbucket, etc.
74
+ go test ... <-- like 'mvn test'
75
+ go install ... <-- install binary to $GOPATH/bin
76
76
```
77
77
78
78
8 Go Directory Structure
@@ -315,7 +315,7 @@ Go's `nil` is like Java's `null`.
315
315
19 Ignoring Return Values
316
316
-------------------------
317
317
318
- In go it's a _ syntax error_ if a varible is decleared but not used:
318
+ In go it's a _ syntax error_ if a variable is declared but not used:
319
319
320
320
``` go
321
321
func main () {
@@ -324,7 +324,7 @@ func main() {
324
324
}
325
325
```
326
326
327
- Syntax error, because variable ` product ` is defined but not used.
327
+ Syntax error, because variable ` product ` is declared but not used.
328
328
329
329
To explicitly ignore a return value, use ` _ ` :
330
330
@@ -600,7 +600,7 @@ Shape 2: rectangle with width 4, height 4, and area 16
600
600
32 Functional Programming
601
601
-------------------------
602
602
603
- Define an anonymous function and assign it to a variable
603
+ Example 1: Define an anonymous function and assign it to a variable
604
604
605
605
``` go
606
606
package main
@@ -615,7 +615,7 @@ func main() {
615
615
}
616
616
```
617
617
618
- Pass a function as parameter to another function
618
+ Example 2: Pass a function as parameter to another function
619
619
620
620
``` go
621
621
package main
@@ -852,7 +852,7 @@ Re-write the channel examples with two go-routines:
852
852
* One producer routine producing numbers
853
853
* One consumer routine printing numbers to stdout
854
854
855
- Terminology: A function called with ` go ... ` is called a go-routine.
855
+ Terminology: A function running as a background thread is a go-routine.
856
856
857
857
41 Waiting for termination
858
858
--------------------------
0 commit comments