diff options
author | 2019-01-28 15:25:14 +0800 | |
---|---|---|
committer | 2019-01-28 07:25:14 +0000 | |
commit | ffe79b026e3dc3b3a1eb1f95224b570d7764e0b6 (patch) | |
tree | ef597b0b2d96381d7bebb00edf85d4f3a80cc0e1 /test/file.go | |
parent | f300fa9bb25f6693bd3d9a314f054c39717250c6 (diff) | |
download | coredns-ffe79b026e3dc3b3a1eb1f95224b570d7764e0b6.tar.gz coredns-ffe79b026e3dc3b3a1eb1f95224b570d7764e0b6.tar.zst coredns-ffe79b026e3dc3b3a1eb1f95224b570d7764e0b6.zip |
Remove duplicated TempFile testsuit (#2508)
Diffstat (limited to 'test/file.go')
-rw-r--r-- | test/file.go | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/test/file.go b/test/file.go deleted file mode 100644 index 626224cac..000000000 --- a/test/file.go +++ /dev/null @@ -1,19 +0,0 @@ -package test - -import ( - "io/ioutil" - "os" -) - -// TempFile will create a temporary file on disk and returns the name and a cleanup function to remove it later. -func TempFile(dir, content string) (string, func(), error) { - f, err := ioutil.TempFile(dir, "go-test-tmpfile") - if err != nil { - return "", nil, err - } - if err := ioutil.WriteFile(f.Name(), []byte(content), 0644); err != nil { - return "", nil, err - } - rmFunc := func() { os.Remove(f.Name()) } - return f.Name(), rmFunc, nil -} |