Use T.cleanup() to cleanup helm-action-test

T.Cleanup() is introduced since go-1.14

Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
pull/8707/head
Li Zhijian 4 years ago
parent 4f7b9fcb67
commit ba4c8029c2

@ -20,6 +20,7 @@ import (
"flag" "flag"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"os"
"path/filepath" "path/filepath"
"testing" "testing"
@ -56,6 +57,8 @@ func actionConfigFixture(t *testing.T) *Configuration {
t.Fatal(err) t.Fatal(err)
} }
t.Cleanup(func() { os.RemoveAll(tdir) })
cache, err := registry.NewCache( cache, err := registry.NewCache(
registry.CacheOptDebug(true), registry.CacheOptDebug(true),
registry.CacheOptRoot(filepath.Join(tdir, registry.CacheRootDir)), registry.CacheOptRoot(filepath.Join(tdir, registry.CacheRootDir)),

Loading…
Cancel
Save