Skip to content

Commit

Permalink
refactor(runtime): update HTTPContext function to accept transhttp.Co…
Browse files Browse the repository at this point in the history
…ntext

- Change HTTPContext function to accept transhttp.Context instead of context.Context
- This change improves type safety and clarity in the codebase
  • Loading branch information
godcong committed Jan 7, 2025
1 parent d28c2ad commit 11ddcf5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ func NewHTTPContext(ctx context.Context, c transhttp.Context) context.Context {
return context.WithValue(ctx, httpCtx{}, c)
}

func HTTPContext(ctx context.Context) context.Context {
return context.WithValue(context.Background(), httpCtx{}, ctx)
func HTTPContext(c transhttp.Context) context.Context {
return context.WithValue(context.Background(), httpCtx{}, c)
}
func FromHTTPContext(ctx context.Context) (transhttp.Context, bool) {
v, ok := ctx.Value(httpCtx{}).(transhttp.Context)
Expand Down

0 comments on commit 11ddcf5

Please sign in to comment.