Skip to content

Commit cc379ab

Browse files
Remove unused context helpers from clientutil package
1 parent b267565 commit cc379ab

1 file changed

Lines changed: 0 additions & 18 deletions

File tree

internal/clientutil/clientutil.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -196,21 +196,3 @@ func (c *Client) ListResourceVersions(ctx context.Context, key ...client.ObjectK
196196
}
197197
return rv, nil
198198
}
199-
200-
type key struct{}
201-
202-
// FromContext returns the [Client] value stored in ctx, if any.
203-
func FromContext(ctx context.Context) (c *Client, ok bool) {
204-
c, ok = ctx.Value(key{}).(*Client)
205-
return
206-
}
207-
208-
// NewContext returns a new [context.Context] that carries the provided [Client] value.
209-
func NewContext(ctx context.Context, c *Client) context.Context {
210-
return context.WithValue(ctx, key{}, c)
211-
}
212-
213-
// IntoContext is a convenience function to add a newly create [Client] to a context.
214-
func IntoContext(ctx context.Context, r client.Reader, ns string) context.Context {
215-
return NewContext(ctx, NewClient(r, ns))
216-
}

0 commit comments

Comments
 (0)