Skip to content

Commit 9256a3f

Browse files
committed
update uncomment usage
1 parent a8c0c8b commit 9256a3f

File tree

14 files changed

+56
-37
lines changed

14 files changed

+56
-37
lines changed

compiled_starters/gleam/src/main.gleam

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@ import gleam/otp/actor
66
import glisten
77

88
pub fn main() {
9+
// Ensures gleam doesn't complain about unused imports in stage 1 (feel free to remove this!)
10+
let _ = glisten.handler
11+
let _ = glisten.serve
12+
let _ = process.sleep_forever
13+
let _ = actor.continue
14+
let _ = None
15+
916
// You can use print statements as follows for debugging, they'll be visible when running tests.
1017
io.println("Logs from your program will appear here!")
11-
18+
1219
// Uncomment this block to pass the first stage
1320
//
1421
// let assert Ok(_) =

compiled_starters/go/app/server.go

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

33
import (
44
"fmt"
5-
// Uncomment this block to pass the first stage
6-
// "net"
7-
// "os"
5+
"net"
6+
"os"
87
)
98

9+
// Ensures gofmt doesn't remove the "net" and "os" imports above (feel free to remove this!)
10+
var _ = net.Listen
11+
var _ = os.Exit
12+
1013
func main() {
1114
// You can use print statements as follows for debugging, they'll be visible when running tests.
1215
fmt.Println("Logs from your program will appear here!")

compiled_starters/python/app/main.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# Uncomment this to pass the first stage
2-
# import socket
1+
import socket # noqa: F401
32

43

54
def main():

compiled_starters/rust/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[allow(unused_imports)]
12
use std::net::TcpListener;
23

34
fn main() {

solutions/gleam/01-at4/code/src/main.gleam

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ import gleam/otp/actor
66
import glisten
77

88
pub fn main() {
9+
// Ensures gleam doesn't complain about unused imports in stage 1 (feel free to remove this!)
10+
let _ = glisten.handler
11+
let _ = glisten.serve
12+
let _ = process.sleep_forever
13+
let _ = actor.continue
14+
let _ = None
15+
916
let assert Ok(_) =
1017
glisten.handler(fn(_conn) { #(Nil, None) }, fn(_msg, state, _conn) {
1118
io.println("Received message!")
Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@@ -1,22 +1,17 @@
1+
@@ -1,29 +1,24 @@
22
import gleam/io
33

44
import gleam/erlang/process
@@ -7,15 +7,16 @@
77
import glisten
88

99
pub fn main() {
10+
// Ensures gleam doesn't complain about unused imports in stage 1 (feel free to remove this!)
11+
let _ = glisten.handler
12+
let _ = glisten.serve
13+
let _ = process.sleep_forever
14+
let _ = actor.continue
15+
let _ = None
16+
1017
- // You can use print statements as follows for debugging, they'll be visible when running tests.
1118
- io.println("Logs from your program will appear here!")
12-
+ let assert Ok(_) =
13-
+ glisten.handler(fn(_conn) { #(Nil, None) }, fn(_msg, state, _conn) {
14-
+ io.println("Received message!")
15-
+ actor.continue(state)
16-
+ })
17-
+ |> glisten.serve(4221)
18-
19+
-
1920
- // Uncomment this block to pass the first stage
2021
- //
2122
- // let assert Ok(_) =
@@ -26,5 +27,12 @@
2627
- // |> glisten.serve(4221)
2728
- //
2829
- // process.sleep_forever()
30+
+ let assert Ok(_) =
31+
+ glisten.handler(fn(_conn) { #(Nil, None) }, fn(_msg, state, _conn) {
32+
+ io.println("Received message!")
33+
+ actor.continue(state)
34+
+ })
35+
+ |> glisten.serve(4221)
36+
+
2937
+ process.sleep_forever()
3038
}

solutions/go/01-at4/code/app/server.go

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

9+
// Ensures gofmt doesn't remove the "net" and "os" imports above (feel free to remove this!)
10+
var _ = net.Listen
11+
var _ = os.Exit
12+
913
func main() {
1014
l, err := net.Listen("tcp", "0.0.0.0:4221")
1115
if err != nil {

solutions/go/01-at4/diff/app/server.go.diff

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
@@ -1,27 +1,21 @@
1+
@@ -1,30 +1,25 @@
22
package main
33

44
import (
55
"fmt"
6-
- // Uncomment this block to pass the first stage
7-
- // "net"
8-
- // "os"
9-
+ "net"
10-
+ "os"
6+
"net"
7+
"os"
118
)
129

10+
// Ensures gofmt doesn't remove the "net" and "os" imports above (feel free to remove this!)
11+
var _ = net.Listen
12+
var _ = os.Exit
13+
1314
func main() {
1415
- // You can use print statements as follows for debugging, they'll be visible when running tests.
1516
- fmt.Println("Logs from your program will appear here!")

solutions/go/01-at4/explanation.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ The entry point for your HTTP server implementation is in `app/server.go`.
22

33
Study and uncomment the relevant code:
44

5-
```go
6-
// Uncomment this block to pass the first stage
7-
"net"
8-
"os"
9-
```
10-
115
```go
126
// Uncomment this block to pass the first stage
137

solutions/python/01-at4/code/app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import socket
1+
import socket # noqa: F401
22

33

44
def main():

0 commit comments

Comments
 (0)