From b9354de8fd5e424ac2f246fff1a03b27e8094fd8 Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 9 Jan 2020 18:21:10 +0100 Subject: Clean up go.mod and vendor --- vendor/golang.org/x/crypto/acme/autocert/cache.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'vendor/golang.org/x/crypto/acme/autocert') diff --git a/vendor/golang.org/x/crypto/acme/autocert/cache.go b/vendor/golang.org/x/crypto/acme/autocert/cache.go index 03f63022..aa9aa845 100644 --- a/vendor/golang.org/x/crypto/acme/autocert/cache.go +++ b/vendor/golang.org/x/crypto/acme/autocert/cache.go @@ -77,7 +77,6 @@ func (d DirCache) Put(ctx context.Context, name string, data []byte) error { if tmp, err = d.writeTempFile(name, data); err != nil { return } - defer os.Remove(tmp) select { case <-ctx.Done(): // Don't overwrite the file if the context was canceled. @@ -117,17 +116,12 @@ func (d DirCache) Delete(ctx context.Context, name string) error { } // writeTempFile writes b to a temporary file, closes the file and returns its path. -func (d DirCache) writeTempFile(prefix string, b []byte) (name string, reterr error) { +func (d DirCache) writeTempFile(prefix string, b []byte) (string, error) { // TempFile uses 0600 permissions f, err := ioutil.TempFile(string(d), prefix) if err != nil { return "", err } - defer func() { - if reterr != nil { - os.Remove(f.Name()) - } - }() if _, err := f.Write(b); err != nil { f.Close() return "", err -- cgit v1.2.3