Use helper HomeDir()

This commit is contained in:
Harshavardhana
2015-02-02 21:44:10 -08:00
parent 246793e30e
commit aff4c5826b
4 changed files with 20 additions and 11 deletions

View File

@@ -14,14 +14,27 @@
* limitations under the License.
*/
package utils
package helpers
import (
"io/ioutil"
"log"
"os"
"runtime"
"strings"
)
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")
}
func MakeTempTestDir() (string, error) {
return ioutil.TempDir("/tmp", "minio-test-")
}

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package utils
package helpers
import (
"bytes"

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package utils
package helpers
import (
"io/ioutil"