diff options
author | Wim <wim@42.be> | 2020-01-09 18:21:10 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2020-01-09 18:21:10 +0100 |
commit | b9354de8fd5e424ac2f246fff1a03b27e8094fd8 (patch) | |
tree | 0207bb88e1e5df2fb32a274cb8de5328b2d058d1 /vendor/golang.org/x/crypto | |
parent | c9d5f4c8989ddf2465a20aac46537369c654b580 (diff) | |
download | matterbridge-msglm-b9354de8fd5e424ac2f246fff1a03b27e8094fd8.tar.gz matterbridge-msglm-b9354de8fd5e424ac2f246fff1a03b27e8094fd8.tar.bz2 matterbridge-msglm-b9354de8fd5e424ac2f246fff1a03b27e8094fd8.zip |
Clean up go.mod and vendor
Diffstat (limited to 'vendor/golang.org/x/crypto')
-rw-r--r-- | vendor/golang.org/x/crypto/acme/autocert/cache.go | 8 |
1 files changed, 1 insertions, 7 deletions
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 |