Skip to content

Commit a0a399c

Browse files
cpustejovskyutamorijohanbaaijBClark88
authored
(WIP) HTTP chapter edits (quii#379)
* Update outdated descriptions and links (quii#358) * Update reflection.md (quii#361) Code examples for chan and func are incorrect * Update select.md (quii#371) Hi all, I've been following this repo to help teach myself go and it's been a great help. I noticed on line 399 the first argument in t.Run doesn't match the assertion. Raising this PR for your consideration as to whether you think this wording fits better or not. * specifying what files need to be created Co-authored-by: 森 優太 mori <59682979+uta-mori@users.noreply.github.com> Co-authored-by: Johan Baaij <johanbaaij@gmail.com> Co-authored-by: Brady <37232811+BClark88@users.noreply.github.com>
1 parent 5cbf8da commit a0a399c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

http-server.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ type Handler interface {
6363

6464
A type implements the Handler interface by implementing the `ServeHTTP` method which expects two arguments, the first is where we _write our response_ and the second is the HTTP request that was sent to the server.
6565

66-
Let's write a test for a function `PlayerServer` that takes in those two arguments. The request sent in will be to get a player's score, which we expect to be `"20"`.
66+
Let's create a file named `server_text.go` and write a test for a function `PlayerServer` that takes in those two arguments. The request sent in will be to get a player's score, which we expect to be `"20"`.
6767

6868
```go
6969
func TestGETPlayers(t *testing.T) {
@@ -96,7 +96,7 @@ In order to test our server, we will need a `Request` to send in and we'll want
9696

9797
The compiler is here to help, just listen to it.
9898

99-
Define `PlayerServer`
99+
Create a file `server.go` and define `PlayerServer`
100100

101101
```go
102102
func PlayerServer() {}
@@ -147,7 +147,7 @@ We want to wire this up into an application. This is important because
147147
- We'll have _actual working software_, we don't want to write tests for the sake of it, it's good to see the code in action.
148148
- As we refactor our code, it's likely we will change the structure of the program. We want to make sure this is reflected in our application too as part of the incremental approach.
149149

150-
Create a new file for our application and put this code in.
150+
Create a new `main.go` file for our application and put this code in
151151

152152
```go
153153
package main

select.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ func TestRacer(t *testing.T) {
396396
}
397397
})
398398

399-
t.Run("returns an error if a server doesn't respond within 10s", func(t *testing.T) {
399+
t.Run("returns an error if a server doesn't respond within the specified time", func(t *testing.T) {
400400
server := makeDelayedServer(25 * time.Millisecond)
401401

402402
defer server.Close()

0 commit comments

Comments
 (0)