Skip to content

Fix table-driven example documentation#363

Merged
kisielk merged 1 commit intogorilla:masterfrom
brandon-height:fix_tdd_documentation
Apr 3, 2018
Merged

Fix table-driven example documentation#363
kisielk merged 1 commit intogorilla:masterfrom
brandon-height:fix_tdd_documentation

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