Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo in select.md #702

Merged
merged 1 commit into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions select.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func TestRacer(t *testing.T) {
fastURL := fastServer.URL

want := fastURL
got, _ := Racer(slowURL, fastURL)
got, err := Racer(slowURL, fastURL)

if err != nil {
t.Fatalf("did not expect an error but got one %v", err)
Expand Down Expand Up @@ -319,7 +319,7 @@ func Racer(a, b string) (winner string, error error) {

Change the signature of `Racer` to return the winner and an `error`. Return `nil` for our happy cases.

The compiler will complain about your _first test_ only looking for one value so change that line to `got, _ := Racer(slowURL, fastURL)`, knowing that we should check we _don't_ get an error in our happy scenario.
The compiler will complain about your _first test_ only looking for one value so change that line to `got, err := Racer(slowURL, fastURL)`, knowing that we should check we _don't_ get an error in our happy scenario.

If you run it now after 11 seconds it will fail.

Expand Down