How to get how long duration set for timeout in context.
example:
func f(ctx context.Context) {
// get ctx timeout value
}
func main() {
ctx, cancel := context.WithTimeout(context.Background(),2*time.Second)
defer cancel()
f(ctx)
}
How to get the duration 2*time.Second from within the function f?