Skip to content

fixed issue fix/#4269 Improved GoDoc in test_helpers.go #4270

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

suwakei
Copy link

@suwakei suwakei commented Jun 18, 2025

Expected Effect

I have made it clearer when and how to use these helper functions by making the GoDoc comments a bit more detailed.

Changes

CreateTestContext:

comments from “Returns a new engine and context for testing purposes” to "Useful for tests that require setting up a new Gin engine instance and its associated context. For example, when testing middleware that does not depend on a specific route." We have made this more specific with

CreateTestContextOnly:

Comment was changed from “Returns a new context based on the engine for testing purposes” to “Useful for tests that run on an existing, possibly preconfigured, Gin engine instance and need a new context for it.” We have made this more specific.
Also, added the information that “Contexts are allocated from the provided engine with the maxParams setting.” to clarify the behavior regarding the allocateContext argument.

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.

1 participant