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 table-driven example documentation #363

Merged
merged 1 commit into from
Apr 3, 2018

Conversation

brandon-height
Copy link
Contributor

Prior to this change, the example documentation found in the README.md has an errant code which
won't work in the table-driven code example.

This change modifies the variable name from t to tc so it does not conflict with the t *testing.T struct definition.

  • Adds a range clause to the for statement
  • Modifies for statement scope to use tc.shouldPass, and tc.routeVariable

Doc: https://github.com/gorilla/mux#testing-handlers

Prior to this change, the example documentation
found in the README.md has an errant code which
won't work in the table-driven code example.

This change modifies the variable name from `t` to `tc`
so it does not conflict with the `t *testing.T` struct
definition.

* Adds a range clause to the `for` statement
* Modifies `for` statement scope to use `tc.shouldPass`, and `tc.routeVariable`

Doc: https://github.com/gorilla/mux#testing-handlers
@kisielk
Copy link
Contributor

kisielk commented Apr 3, 2018

Good catch, thank you.

@kisielk kisielk merged commit 94231ff into gorilla:master Apr 3, 2018
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.

2 participants