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

Problematic suggestion about the select chapter #834

Open
stefanos82 opened this issue Jan 5, 2025 · 0 comments
Open

Problematic suggestion about the select chapter #834

stefanos82 opened this issue Jan 5, 2025 · 0 comments

Comments

@stefanos82
Copy link

In this suggestion,

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.

you are missing the implementation for

if err != nil {
    t.Fatalf("did not expect an error but got one %v", err)
}

because if we add the err here in got, err := Racer(slowURL, fastURL), the compiler will complain about err being unused here.

I know that the aforementioned if condition is mentioned afterwards, but it should have been demonstrated immediately after the err suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant