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

Remove uncompilable if block from code example #191

Merged
merged 1 commit into from
Jun 26, 2019
Merged

Remove uncompilable if block from code example #191

merged 1 commit into from
Jun 26, 2019

Conversation

Nickknack
Copy link
Contributor

In the context exercise we update SpyStore to remove the cancel from the spy and just pass the context into the fetch. In one of the if statements of the happy path we reference store.ctx.
Just removed the if statement to make the test actually run and pass like the instructions say.

@Nickknack
Copy link
Contributor Author

if store.ctx != request.Context() { t.Errorf("store was not passed through a context %v", store.ctx) }
Is the if statement that doesn't compile.

type SpyStore struct { response string t *testing.T }

Is how the SpyStore type is being defined in the previous step.

@quii
Copy link
Owner

quii commented Jun 9, 2019

Thanks for this, just a heads up that I'm not ignoring it and I'll be checking this out at some point this week

@Jragon
Copy link
Contributor

Jragon commented Jun 13, 2019

You will need to update the test output too.

=== RUN   TestServer/returns_data_from_store
--- FAIL: TestServer (0.00s)
    --- FAIL: TestServer/returns_data_from_store (0.00s)
    	context_test.go:22: got "", want "hello, world"
    	context_test.go:26: store was not passed through a context <nil>

should become

Try to run the test

=== RUN   TestServer/returns_data_from_store
--- FAIL: TestServer (0.00s)
    --- FAIL: TestServer/returns_data_from_store (0.00s)
    	context_test.go:22: got "", want "hello, world"

related to #156

@Nickknack
Copy link
Contributor Author

@Jragon @quii ah, cool! If there's already an issue open for this, should I just close this pr?

@quii quii merged commit 9f7e8fd into quii:master Jun 26, 2019
@quii
Copy link
Owner

quii commented Jun 26, 2019

@Nickknack so sorry for taking long with this. Re the other bit, I'll fix that now

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

Successfully merging this pull request may close these issues.

3 participants