Skip to content

contrib/gin-gonic/gin: refactor Option, deprecate OptionFn #3650

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: main
Choose a base branch
from

Conversation

dolmen
Copy link

@dolmen dolmen commented Jun 17, 2025

What does this PR do?

Full rationale for this change: see discussion #3612

This change is fully source compatible with existing client code. Also, as implementation details are now hidden behind the new private option type, the API is more future-proof.

Motivation

API cleanup.

Full rationale for this change: #3612

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • System-Tests covering this feature have been added and enabled with the va.b.c-dev version tag.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.
  • New code is free of linting errors. You can check this by running golangci-lint run locally.
  • Add an appropriate team label so this PR gets put in the right place for the release notes.
  • Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild.

Unsure? Have a question? Request a review!

@dolmen dolmen requested review from a team as code owners June 17, 2025 12:52
@dolmen dolmen force-pushed the contrib-gin-OptionFn branch from fd98e83 to ffd0494 Compare June 17, 2025 13:00
Refactor Options handling.
Deprecate OptionFn which was an implementation detail that is not needed
anymore.

This change is fully source compatible with existing client code. Also,
as implementation details are now hidden behind the private 'option'
type, the API is more future-proof.

Full rationale for this change: DataDog#3612

Note: golangci-lint 2.1.6 reports lint error "unexported-return: exported func
WithAnalytics returns unexported type gin.Option, which can be annoying to use (revive)"
However this is false positive that I have reported in
mgechev/revive#1406.

Signed-off-by: Olivier Mengué <[email protected]>
@dolmen dolmen force-pushed the contrib-gin-OptionFn branch from ffd0494 to 604795a Compare June 17, 2025 13:07
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