aboutsummaryrefslogtreecommitdiff
path: root/test/file.go
diff options
context:
space:
mode:
authorGravatar Xuanwo <xuanwo.cn@gmail.com> 2019-01-28 15:25:14 +0800
committerGravatar Miek Gieben <miek@miek.nl> 2019-01-28 07:25:14 +0000
commitffe79b026e3dc3b3a1eb1f95224b570d7764e0b6 (patch)
treeef597b0b2d96381d7bebb00edf85d4f3a80cc0e1 /test/file.go
parentf300fa9bb25f6693bd3d9a314f054c39717250c6 (diff)
downloadcoredns-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.go19
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
-}