mirror of
https://github.com/minio/minio.git
synced 2025-11-07 04:42:56 -05:00
Use helper HomeDir()
This commit is contained in:
@@ -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-")
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package utils
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package utils
|
||||
package helpers
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
Reference in New Issue
Block a user