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
Small reformatting to make linter happy
master
T. Meissner
4 years ago
parent
a84c706529
commit
1f8d7f9183
15 changed files
with
20 additions
and
37 deletions
Unified View
Diff Options
Show Stats
Download Patch File
Download Diff File
+1
-2
chapter_01/activity_1.01/main.go
+1
-2
chapter_01/exercise_1.01/main.go
+0
-2
chapter_01/exercise_1.02/main.go
+4
-6
chapter_01/exercise_1.03/main.go
+2
-4
chapter_01/exercise_1.04/main.go
+1
-2
chapter_01/exercise_1.05/main.go
+0
-2
chapter_01/exercise_1.06/main.go
+1
-3
chapter_01/exercise_1.07/main.go
+1
-2
chapter_01/exercise_1.08/main.go
+1
-2
chapter_01/exercise_1.09/main.go
+1
-2
chapter_01/exercise_1.10/main.go
+1
-2
chapter_01/exercise_1.11/main.go
+1
-2
chapter_01/exercise_1.12/main.go
+2
-3
chapter_01/exercise_1.13/main.go
+3
-1
test/main.go
+ 1
- 2
chapter_01/activity_1.01/main.go
View File
@ -4,7 +4,6 @@ import (
"fmt"
"fmt"
)
)
func
main
(
)
{
func
main
(
)
{
firstName
:=
"Torsten"
firstName
:=
"Torsten"
@ -17,4 +16,4 @@ func main() {
fmt
.
Println
(
age
)
fmt
.
Println
(
age
)
fmt
.
Println
(
peanutAllergy
)
fmt
.
Println
(
peanutAllergy
)
}
}
+ 1
- 2
chapter_01/exercise_1.01/main.go
View File
@ -7,7 +7,6 @@ import (
"time"
"time"
)
)
func
main
(
)
{
func
main
(
)
{
rand
.
Seed
(
time
.
Now
(
)
.
UnixNano
(
)
)
rand
.
Seed
(
time
.
Now
(
)
.
UnixNano
(
)
)
@ -18,4 +17,4 @@ func main() {
fmt
.
Println
(
stars
)
fmt
.
Println
(
stars
)
}
}
+ 0
- 2
chapter_01/exercise_1.02/main.go
View File
@ -2,10 +2,8 @@ package main
import
"fmt"
import
"fmt"
var
foo
string
=
"bar"
var
foo
string
=
"bar"
func
main
(
)
{
func
main
(
)
{
var
baz
string
=
"qux"
var
baz
string
=
"qux"
+ 4
- 6
chapter_01/exercise_1.03/main.go
View File
@ -5,16 +5,14 @@ import (
"time"
"time"
)
)
var
(
var
(
Debug
bool
=
false
LogLevel
string
=
"info"
Debug
bool
=
false
LogLevel
string
=
"info"
startUpTime
time
.
Time
=
time
.
Now
(
)
startUpTime
time
.
Time
=
time
.
Now
(
)
)
)
func
main
(
)
{
func
main
(
)
{
fmt
.
Println
(
Debug
,
LogLevel
,
startUpTime
)
fmt
.
Println
(
Debug
,
LogLevel
,
startUpTime
)
}
}
+ 2
- 4
chapter_01/exercise_1.04/main.go
View File
@ -5,14 +5,12 @@ import (
"time"
"time"
)
)
var
(
var
(
Debug
bool
LogLevel
=
"info"
Debug
bool
LogLevel
=
"info"
startUpTime
=
time
.
Now
(
)
startUpTime
=
time
.
Now
(
)
)
)
func
main
(
)
{
func
main
(
)
{
fmt
.
Println
(
Debug
,
LogLevel
,
startUpTime
)
fmt
.
Println
(
Debug
,
LogLevel
,
startUpTime
)
+ 1
- 2
chapter_01/exercise_1.05/main.go
View File
@ -5,7 +5,6 @@ import (
"time"
"time"
)
)
func
main
(
)
{
func
main
(
)
{
Debug
:=
false
Debug
:=
false
@ -14,4 +13,4 @@ func main() {
fmt
.
Println
(
Debug
,
LogLevel
,
startUpTime
)
fmt
.
Println
(
Debug
,
LogLevel
,
startUpTime
)
}
}
+ 0
- 2
chapter_01/exercise_1.06/main.go
View File
@ -5,14 +5,12 @@ import (
"time"
"time"
)
)
func
getConfig
(
)
(
bool
,
string
,
time
.
Time
)
{
func
getConfig
(
)
(
bool
,
string
,
time
.
Time
)
{
return
false
,
"info"
,
time
.
Now
(
)
return
false
,
"info"
,
time
.
Now
(
)
}
}
func
main
(
)
{
func
main
(
)
{
Debug
,
LogLevel
,
startUpTime
:=
getConfig
(
)
Debug
,
LogLevel
,
startUpTime
:=
getConfig
(
)
+ 1
- 3
chapter_01/exercise_1.07/main.go
View File
@ -2,10 +2,8 @@ package main
import
"fmt"
import
"fmt"
var
defaultOffset
=
10
var
defaultOffset
=
10
func
main
(
)
{
func
main
(
)
{
offset
:=
5
offset
:=
5
@ -16,4 +14,4 @@ func main() {
offset
=
offset
+
defaultOffset
offset
=
offset
+
defaultOffset
fmt
.
Println
(
offset
)
fmt
.
Println
(
offset
)
}
}
+ 1
- 2
chapter_01/exercise_1.08/main.go
View File
@ -2,11 +2,10 @@ package main
import
"fmt"
import
"fmt"
func
main
(
)
{
func
main
(
)
{
query
,
limit
,
offset
:=
"bat"
,
10
,
0
query
,
limit
,
offset
:=
"bat"
,
10
,
0
query
,
limit
,
offset
=
"ball"
,
offset
,
20
query
,
limit
,
offset
=
"ball"
,
offset
,
20
fmt
.
Println
(
query
,
limit
,
offset
)
fmt
.
Println
(
query
,
limit
,
offset
)
}
}
+ 1
- 2
chapter_01/exercise_1.09/main.go
View File
@ -2,7 +2,6 @@ package main
import
"fmt"
import
"fmt"
func
main
(
)
{
func
main
(
)
{
// Main course
// Main course
@ -36,4 +35,4 @@ func main() {
fmt
.
Println
(
"With this visit, you've earned a reward."
)
fmt
.
Println
(
"With this visit, you've earned a reward."
)
}
}
}
}
+ 1
- 2
chapter_01/exercise_1.10/main.go
View File
@ -2,7 +2,6 @@ package main
import
"fmt"
import
"fmt"
func
main
(
)
{
func
main
(
)
{
count
:=
5
count
:=
5
@ -19,4 +18,4 @@ func main() {
name
+=
" Smith"
name
+=
" Smith"
fmt
.
Println
(
name
)
fmt
.
Println
(
name
)
}
}
+ 1
- 2
chapter_01/exercise_1.11/main.go
View File
@ -2,7 +2,6 @@ package main
import
"fmt"
import
"fmt"
func
main
(
)
{
func
main
(
)
{
visits
:=
15
visits
:=
15
@ -12,4 +11,4 @@ func main() {
fmt
.
Println
(
"Gold member :"
,
visits
>
20
&&
visits
<=
30
)
fmt
.
Println
(
"Gold member :"
,
visits
>
20
&&
visits
<=
30
)
fmt
.
Println
(
"Platinum member:"
,
visits
>
30
)
fmt
.
Println
(
"Platinum member:"
,
visits
>
30
)
}
}
+ 1
- 2
chapter_01/exercise_1.12/main.go
View File
@ -5,7 +5,6 @@ import (
"time"
"time"
)
)
func
main
(
)
{
func
main
(
)
{
var
count
int
var
count
int
@ -26,4 +25,4 @@ func main() {
var
startTime
time
.
Time
var
startTime
time
.
Time
fmt
.
Printf
(
"Start: %#v \n"
,
startTime
)
fmt
.
Printf
(
"Start: %#v \n"
,
startTime
)
}
}
+ 2
- 3
chapter_01/exercise_1.13/main.go
View File
@ -5,12 +5,11 @@ import (
"time"
"time"
)
)
func
main
(
)
{
func
main
(
)
{
var
count1
*
int
var
count1
*
int
count2
:=
new
(
int
)
count2
:=
new
(
int
)
countTemp
:=
5
countTemp
:=
5
count3
:=
&
countTemp
count3
:=
&
countTemp
t
:=
&
time
.
Time
{
}
t
:=
&
time
.
Time
{
}
@ -19,4 +18,4 @@ func main() {
fmt
.
Printf
(
"count3: %#v\n"
,
count3
)
fmt
.
Printf
(
"count3: %#v\n"
,
count3
)
fmt
.
Printf
(
"time : %#v\n"
,
t
)
fmt
.
Printf
(
"time : %#v\n"
,
t
)
}
}
+ 3
- 1
test/main.go
View File
@ -1,7 +1,9 @@
package
main
package
main
import
(
import
(
"fmt"
"fmt"
)
)
func
main
(
)
{
func
main
(
)
{
fmt
.
Println
(
"This is a test"
)
fmt
.
Println
(
"This is a test"
)
}
}
Write
Preview
Loading…
Cancel
Save