From b5afed52016c750584c6ca1a7ec8f52359f0f419 Mon Sep 17 00:00:00 2001 From: vlastahajek Date: Mon, 7 Sep 2020 15:10:49 +0200 Subject: [PATCH] fix(compile): Making influxd compilable on Windows --- pkg/fs/fs.go | 17 +++++++++++++++++ pkg/fs/fs_unix.go | 15 --------------- 2 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 pkg/fs/fs.go diff --git a/pkg/fs/fs.go b/pkg/fs/fs.go new file mode 100644 index 00000000000..d40495bdaba --- /dev/null +++ b/pkg/fs/fs.go @@ -0,0 +1,17 @@ +package fs + +import "fmt" + +// A FileExistsError is returned when an operation cannot be completed due to a +// file already existing. +type FileExistsError struct { + path string +} + +func newFileExistsError(path string) FileExistsError { + return FileExistsError{path: path} +} + +func (e FileExistsError) Error() string { + return fmt.Sprintf("operation not allowed, file %q exists", e.path) +} diff --git a/pkg/fs/fs_unix.go b/pkg/fs/fs_unix.go index 66bb1712499..94bf85feea2 100644 --- a/pkg/fs/fs_unix.go +++ b/pkg/fs/fs_unix.go @@ -3,25 +3,10 @@ package fs import ( - "fmt" "os" "syscall" ) -// A FileExistsError is returned when an operation cannot be completed due to a -// file already existing. -type FileExistsError struct { - path string -} - -func newFileExistsError(path string) FileExistsError { - return FileExistsError{path: path} -} - -func (e FileExistsError) Error() string { - return fmt.Sprintf("operation not allowed, file %q exists", e.path) -} - // SyncDir flushes any file renames to the filesystem. func SyncDir(dirName string) error { // fsync the dir to flush the rename