This website works better with JavaScript.
Home
Help
Sign In
tmeissner
/
go_workshop
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
Initial commit
master
T. Meissner
4 years ago
commit
b05d597589
6 changed files
with
103 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+20
-0
chapter_01/activity_1.01/main.go
+21
-0
chapter_01/exercise_1.01/main.go
+15
-0
chapter_01/exercise_1.02/main.go
+20
-0
chapter_01/exercise_1.03/main.go
+20
-0
chapter_01/exercise_1.04/main.go
+7
-0
test/main.go
+ 20
- 0
chapter_01/activity_1.01/main.go
View File
@ -0,0 +1,20 @@
package
main
import
(
"fmt"
)
func
main
(
)
{
firstName
:=
"Torsten"
familyName
:=
"Meißner"
age
:=
41
peanutAllergy
:=
false
fmt
.
Println
(
firstName
)
fmt
.
Println
(
familyName
)
fmt
.
Println
(
age
)
fmt
.
Println
(
peanutAllergy
)
}
+ 21
- 0
chapter_01/exercise_1.01/main.go
View File
@ -0,0 +1,21 @@
package
main
import
(
"fmt"
"math/rand"
"strings"
"time"
)
func
main
(
)
{
rand
.
Seed
(
time
.
Now
(
)
.
UnixNano
(
)
)
r
:=
rand
.
Intn
(
5
)
+
1
stars
:=
strings
.
Repeat
(
"*"
,
r
)
fmt
.
Println
(
stars
)
}
+ 15
- 0
chapter_01/exercise_1.02/main.go
View File
@ -0,0 +1,15 @@
package
main
import
"fmt"
var
foo
string
=
"bar"
func
main
(
)
{
var
baz
string
=
"qux"
fmt
.
Println
(
foo
,
baz
)
}
+ 20
- 0
chapter_01/exercise_1.03/main.go
View File
@ -0,0 +1,20 @@
package
main
import
(
"fmt"
"time"
)
var
(
Debug
bool
=
false
LogLevel
string
=
"info"
startUpTime
time
.
Time
=
time
.
Now
(
)
)
func
main
(
)
{
fmt
.
Println
(
Debug
,
LogLevel
,
startUpTime
)
}
+ 20
- 0
chapter_01/exercise_1.04/main.go
View File
@ -0,0 +1,20 @@
package
main
import
(
"fmt"
"time"
)
var
(
Debug
bool
LogLevel
=
"info"
startUpTime
=
time
.
Now
(
)
)
func
main
(
)
{
fmt
.
Println
(
Debug
,
LogLevel
,
startUpTime
)
}
+ 7
- 0
test/main.go
View File
@ -0,0 +1,7 @@
package
main
import
(
"fmt"
)
func
main
(
)
{
fmt
.
Println
(
"This is a test"
)
}
Write
Preview
Loading…
Cancel
Save