Skip to content

Commit 8d794f6

Browse files
committed
Refactor output statement in main.go to use fmt.Print instead of fmt.Fprint. Remove outdated explanation.md file.
1 parent e09ebcc commit 8d794f6

File tree

7 files changed

+22
-48
lines changed

7 files changed

+22
-48
lines changed

compiled_starters/go/app/main.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ package main
22

33
import (
44
"fmt"
5-
"os"
65
)
76

8-
// Ensures gofmt doesn't remove the "fmt" and "os" imports in stage 1 (feel free to remove this!)
9-
var _ = fmt.Fprint
10-
var _ = os.Stdout
7+
// Ensures gofmt doesn't remove the "fmt" import in stage 1 (feel free to remove this!)
8+
var _ = fmt.Print
119

1210
func main() {
1311
// TODO: Uncomment the code below to pass the first stage
14-
// fmt.Fprint(os.Stdout, "$ ")
12+
// fmt.Print("$ ")
1513
}

solutions/go/01-oo8/code/app/main.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@ package main
22

33
import (
44
"fmt"
5-
"os"
65
)
76

8-
// Ensures gofmt doesn't remove the "fmt" and "os" imports in stage 1 (feel free to remove this!)
9-
var _ = fmt.Fprint
10-
var _ = os.Stdout
7+
// Ensures gofmt doesn't remove the "fmt" import in stage 1 (feel free to remove this!)
8+
var _ = fmt.Print
119

1210
func main() {
13-
fmt.Fprint(os.Stdout, "$ ")
11+
fmt.Print("$ ")
1412
}
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
@@ -1,15 +1,14 @@
1+
@@ -1,13 +1,12 @@
22
package main
33

44
import (
55
"fmt"
6-
"os"
76
)
87

9-
// Ensures gofmt doesn't remove the "fmt" and "os" imports in stage 1 (feel free to remove this!)
10-
var _ = fmt.Fprint
11-
var _ = os.Stdout
8+
// Ensures gofmt doesn't remove the "fmt" import in stage 1 (feel free to remove this!)
9+
var _ = fmt.Print
1210

1311
func main() {
1412
- // TODO: Uncomment the code below to pass the first stage
15-
- // fmt.Fprint(os.Stdout, "$ ")
16-
+ fmt.Fprint(os.Stdout, "$ ")
13+
- // fmt.Print("$ ")
14+
+ fmt.Print("$ ")
1715
}

solutions/go/01-oo8/explanation.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

solutions/go/02-cz2/code/app/main.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ import (
66
"os"
77
)
88

9-
// Ensures gofmt doesn't remove the "fmt" and "os" imports in stage 1 (feel free to remove this!)
10-
var _ = fmt.Fprint
11-
var _ = os.Stdout
9+
// Ensures gofmt doesn't remove the "fmt" import in stage 1 (feel free to remove this!)
10+
var _ = fmt.Print
1211

1312
func main() {
14-
fmt.Fprint(os.Stdout, "$ ")
13+
fmt.Print("$ ")
1514

1615
// Wait for user input
1716
command, err := bufio.NewReader(os.Stdin).ReadString('\n')

solutions/go/02-cz2/diff/app/main.go.diff

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
@@ -1,14 +1,23 @@
1+
@@ -1,12 +1,22 @@
22
package main
33

44
import (
55
+ "bufio"
66
"fmt"
7-
"os"
7+
+ "os"
88
)
99

10-
// Ensures gofmt doesn't remove the "fmt" and "os" imports in stage 1 (feel free to remove this!)
11-
var _ = fmt.Fprint
12-
var _ = os.Stdout
10+
// Ensures gofmt doesn't remove the "fmt" import in stage 1 (feel free to remove this!)
11+
var _ = fmt.Print
1312

1413
func main() {
15-
fmt.Fprint(os.Stdout, "$ ")
14+
fmt.Print("$ ")
1615
+
1716
+ // Wait for user input
1817
+ command, err := bufio.NewReader(os.Stdin).ReadString('\n')

starter_templates/go/code/app/main.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ package main
22

33
import (
44
"fmt"
5-
"os"
65
)
76

8-
// Ensures gofmt doesn't remove the "fmt" and "os" imports in stage 1 (feel free to remove this!)
9-
var _ = fmt.Fprint
10-
var _ = os.Stdout
7+
// Ensures gofmt doesn't remove the "fmt" import in stage 1 (feel free to remove this!)
8+
var _ = fmt.Print
119

1210
func main() {
1311
// TODO: Uncomment the code below to pass the first stage
14-
// fmt.Fprint(os.Stdout, "$ ")
12+
// fmt.Print("$ ")
1513
}

0 commit comments

Comments
 (0)