Skip to content
New issue

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

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

Already on GitHub? # 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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants