diff options
Diffstat (limited to 'util')
-rw-r--r-- | util/network_windows.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/util/network_windows.go b/util/network_windows.go index e5bc67c8..843d5779 100644 --- a/util/network_windows.go +++ b/util/network_windows.go @@ -30,4 +30,14 @@ func CreateListener(address string) (net.Listener, error) { } return net.Listen(dsn[0], dsn[1]) -}
\ No newline at end of file +} + +// fileExists checks if a file exists and is not a directory before we +// try using it to prevent further errors. +func fileExists(filename string) bool { + info, err := os.Stat(filename) + if os.IsNotExist(err) { + return false + } + return !info.IsDir() +} |