Merge pull request #241 from abperiasamy/janitor

On janitor duty.
This commit is contained in:
Anand Babu (AB) Periasamy
2015-03-01 16:43:04 -08:00
3 changed files with 13 additions and 28 deletions

View File

@@ -18,36 +18,14 @@ package helpers
import (
"io/ioutil"
"log"
"os"
"runtime"
"strings"
)
// Get current user home directory
func HomeDir() string {
if runtime.GOOS == "windows" {
home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
if home == "" {
home = os.Getenv("USERPROFILE")
}
return home
}
return os.Getenv("HOME")
}
// Create a new temp directory
func MakeTempTestDir() (string, error) {
return ioutil.TempDir("/tmp", "minio-test-")
}
// Assert wrapper for error not being null
func Assert(err error) {
if err != nil {
log.Fatal(err)
}
}
// Camelcase input string
func FirstUpper(str string) string {
return strings.ToUpper(str[0:1]) + str[1:]