From bd1c74594efeab1268531225d304ebae8992e286 Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Wed, 14 Oct 2020 14:27:16 +0200 Subject: document non-threadsafety --- container.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'container.go') diff --git a/container.go b/container.go index 4c94f87..de85f62 100644 --- a/container.go +++ b/container.go @@ -74,6 +74,9 @@ func (c *Container) Exists() (bool, error) { //has not been cached yet, a HEAD request is issued on the container. // //This operation fails with http.StatusNotFound if the container does not exist. +// +//WARNING: This method is not thread-safe. Calling it concurrently on the same +//object results in undefined behavior. func (c *Container) Headers() (ContainerHeaders, error) { if c.headers != nil { return *c.headers, nil @@ -159,6 +162,9 @@ func (c *Container) Delete(opts *RequestOptions) error { //Invalidate clears the internal cache of this Container instance. The next call //to Headers() on this instance will issue a HEAD request on the container. +// +//WARNING: This method is not thread-safe. Calling it concurrently on the same +//object results in undefined behavior. func (c *Container) Invalidate() { c.headers = nil } -- cgit v1.2.3