lib/ec2macossystemmonitor/util.go (11 lines of code) (raw):
package ec2macossystemmonitor
import (
"os"
)
// fileExists returns true if a file exists and is not a directory.
func fileExists(filename string) bool {
info, err := os.Stat(filename)
if os.IsNotExist(err) {
return false
}
return !info.IsDir()
}