diff options
author | Valery Piashchynski <[email protected]> | 2020-03-03 18:57:52 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-03-03 18:57:52 +0300 |
commit | aa0ba5496c101e41a497285b4e0f4e9f2820b5e7 (patch) | |
tree | dadbacfbbcd99e2306fa0996393b31106a0542bb /util | |
parent | 9fabf648f1c3cb797ec03377c3e2182397fb7a1a (diff) |
Fix typos
Update signals handling mechanism
http proper stopping
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() +} |