Skip to content

Commit e51d1cb

Browse files
authored
Merge pull request #19511 from vlastahajek/fix/windows_compile
fix(InfluxDB 2): Making influxd compilable on Windows
2 parents 8757b5b + b5afed5 commit e51d1cb

File tree

2 files changed

+17
-15
lines changed

2 files changed

+17
-15
lines changed

pkg/fs/fs.go

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package fs
2+
3+
import "fmt"
4+
5+
// A FileExistsError is returned when an operation cannot be completed due to a
6+
// file already existing.
7+
type FileExistsError struct {
8+
path string
9+
}
10+
11+
func newFileExistsError(path string) FileExistsError {
12+
return FileExistsError{path: path}
13+
}
14+
15+
func (e FileExistsError) Error() string {
16+
return fmt.Sprintf("operation not allowed, file %q exists", e.path)
17+
}

pkg/fs/fs_unix.go

-15
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,10 @@
33
package fs
44

55
import (
6-
"fmt"
76
"os"
87
"syscall"
98
)
109

11-
// A FileExistsError is returned when an operation cannot be completed due to a
12-
// file already existing.
13-
type FileExistsError struct {
14-
path string
15-
}
16-
17-
func newFileExistsError(path string) FileExistsError {
18-
return FileExistsError{path: path}
19-
}
20-
21-
func (e FileExistsError) Error() string {
22-
return fmt.Sprintf("operation not allowed, file %q exists", e.path)
23-
}
24-
2510
// SyncDir flushes any file renames to the filesystem.
2611
func SyncDir(dirName string) error {
2712
// fsync the dir to flush the rename

0 commit comments

Comments
 (0)