More updates on documentation

This commit is contained in:
Harshavardhana
2015-02-23 17:44:55 -08:00
parent 2b8adef454
commit 5e1e5ad786
8 changed files with 58 additions and 14 deletions

View File

@@ -24,6 +24,7 @@ import (
"strings"
)
// Get current user home directory
func HomeDir() string {
if runtime.GOOS == "windows" {
home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
@@ -35,16 +36,19 @@ func HomeDir() string {
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:]
}

View File

@@ -26,7 +26,8 @@ import (
// A simple ExecPipe() pipes exec.Cmd together - somewhat similar to how bash pipes "|" behave.
// Each command's standard output is connected to the standard input of the next command
// and the output of the final command is returned
//
// TODO: handle errors properly
func ExecPipe(cmds ...*exec.Cmd) (pipeLineOutput io.Reader, pipeLineError error) {
// Require at least one command
if len(cmds) < 1 {