Add key generation.

This commit is contained in:
Brendan Burns
2015-05-28 11:45:08 -07:00
committed by CJ Cullen
parent 30a89968a4
commit 5115fd5703
13 changed files with 162 additions and 5 deletions

View File

@@ -515,4 +515,16 @@ func ShortenString(str string, n int) string {
} else {
return str[:n]
}
func FileExists(filename string) (bool, error) {
file, err := os.Open(filename)
defer file.Close()
if err != nil {
if os.IsNotExist(err) {
return false, nil
} else {
return false, err
}
}
return true, nil
}