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

cli.Context does not implement context.Context #2049

Open
kke opened this issue Feb 5, 2025 · 1 comment
Open

cli.Context does not implement context.Context #2049

kke opened this issue Feb 5, 2025 · 1 comment
Labels
area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this

Comments

@kke
Copy link
Contributor

kke commented Feb 5, 2025

The cli.Context embeds and would work directly as context.Context if it wasn't for the Value(name string) interface{} which conflicts with Value(key any) any of context.Context interface.

This could be nice to have so you could use DoSomething(ctx) instead of having to use DoSomething(ctx.Context).

It could be possible to change the Value function to match the interface without breaking the api. It could fall back to looking for the value from the ctx.Context if the key is not a string or was not found from the flags.

It seems that the context.Context interface's functionality is not being utilized for anything internally in v2.

It seems that the cli.Context has been replaced with a regular context.Context in main(v3?)

@kke kke added area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this labels Feb 5, 2025
@dearchap
Copy link
Contributor

dearchap commented Feb 5, 2025

@kke Yes correct. We are using a context.Context in v3. There are no plans to change anything in v2 as it is in maintenance mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/v2 relates to / is being considered for v2 kind/bug describes or fixes a bug status/triage maintainers still need to look into this
Projects
None yet
Development

No branches or pull requests

2 participants