(ctx context.Context)
| 981 | var externalDepthKey contextKey |
| 982 | |
| 983 | func externalDepthFromContext(ctx context.Context) int { |
| 984 | if v, ok := ctx.Value(externalDepthKey).(int); ok { |
| 985 | return v |
| 986 | } |
| 987 | return 0 |
| 988 | } |
| 989 | |
| 990 | func contextWithExternalDepth(ctx context.Context, depth int) context.Context { |
| 991 | return context.WithValue(ctx, externalDepthKey, depth) |