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

Deprecated Code in Generated http.go using goa example #3448

Open
gobijan opened this issue Jan 13, 2024 · 0 comments
Open

Deprecated Code in Generated http.go using goa example #3448

gobijan opened this issue Jan 13, 2024 · 0 comments

Comments

@gobijan
Copy link

gobijan commented Jan 13, 2024

Description:
When generating the http.go file using the goa example command, the generated code includes a deprecated function httpmdlwr.RequestID. This leads to the following deprecation warning:

httpmdlwr.RequestID is deprecated: use OpenTelemetry instead, see for example github.com/goadesign/clue. This function will be removed in a future version of Goa.deprecated(default)

Problematic Code:

// Wrap the multiplexer with additional middlewares. Middlewares mounted
// here apply to all the service endpoints.
var handler http.Handler = mux
{
    handler = httpmdlwr.Log(adapter)(handler)
    handler = httpmdlwr.RequestID()(handler)
}

Suggested Fix:
It would be beneficial for the default example generation to utilize the clue package in place of the deprecated httpmdlwr.RequestID function. This aligns with current best practices and avoids the introduction of deprecated code in new projects.

Impact:
This issue impacts new users or projects using Goa, as it introduces deprecated code right from the start, potentially leading to future compatibility issues.

@gobijan gobijan changed the title Make use of clue package for generated example to avoid deprecation warnings. Deprecated Code in Generated http.go using goa example Jan 17, 2024
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

No branches or pull requests

1 participant