aboutsummaryrefslogtreecommitdiff
path: root/plugin/auto/watcher_test.go
diff options
context:
space:
mode:
authorGravatar Manuel Stocker <mensi@mensi.ch> 2018-10-21 15:59:37 +0200
committerGravatar corbot[bot] <corbot[bot]@users.noreply.github.com> 2018-10-21 13:59:37 +0000
commit4b1b0ec9e61dcf02dc7a79e504ca3eae4a3b4b53 (patch)
tree5ccb309de73dcf49cc4370ec3e08a64604b8e347 /plugin/auto/watcher_test.go
parentcf0422371825e97608950d015b5f570416444d4f (diff)
downloadcoredns-4b1b0ec9e61dcf02dc7a79e504ca3eae4a3b4b53.tar.gz
coredns-4b1b0ec9e61dcf02dc7a79e504ca3eae4a3b4b53.tar.zst
coredns-4b1b0ec9e61dcf02dc7a79e504ca3eae4a3b4b53.zip
Use filepath when manipulating file paths (#2221)
Automatically submitted.
Diffstat (limited to 'plugin/auto/watcher_test.go')
-rw-r--r--plugin/auto/watcher_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugin/auto/watcher_test.go b/plugin/auto/watcher_test.go
index 1d707d747..a7013448b 100644
--- a/plugin/auto/watcher_test.go
+++ b/plugin/auto/watcher_test.go
@@ -2,7 +2,7 @@ package auto
import (
"os"
- "path"
+ "path/filepath"
"regexp"
"testing"
)
@@ -39,7 +39,7 @@ func TestWatcher(t *testing.T) {
}
// Now remove one file, rescan and see if it's gone.
- if err := os.Remove(path.Join(tempdir, "db.example.com")); err != nil {
+ if err := os.Remove(filepath.Join(tempdir, "db.example.com")); err != nil {
t.Fatal(err)
}
@@ -78,15 +78,15 @@ func TestSymlinks(t *testing.T) {
a.Walk()
// Now create a duplicate file in a subdirectory and repoint the symlink
- if err := os.Remove(path.Join(tempdir, "db.example.com")); err != nil {
+ if err := os.Remove(filepath.Join(tempdir, "db.example.com")); err != nil {
t.Fatal(err)
}
- dataDir := path.Join(tempdir, "..data")
+ dataDir := filepath.Join(tempdir, "..data")
if err = os.Mkdir(dataDir, 0755); err != nil {
t.Fatal(err)
}
- newFile := path.Join(dataDir, "db.example.com")
- if err = os.Symlink(path.Join(tempdir, "db.example.org"), newFile); err != nil {
+ newFile := filepath.Join(dataDir, "db.example.com")
+ if err = os.Symlink(filepath.Join(tempdir, "db.example.org"), newFile); err != nil {
t.Fatal(err)
}