mirror of https://github.com/docker/docs.git
merge 'origin/master' into driver-refactor
This commit is contained in:
commit
c6ca050653
|
@ -1,12 +1,15 @@
|
||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
log "github.com/Sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetHomeDir() string {
|
func GetHomeDir() string {
|
||||||
|
@ -95,3 +98,13 @@ func WaitForSpecific(f func() bool, maxAttempts int, waitInterval time.Duration)
|
||||||
func WaitFor(f func() bool) error {
|
func WaitFor(f func() bool) error {
|
||||||
return WaitForSpecific(f, 60, 3*time.Second)
|
return WaitForSpecific(f, 60, 3*time.Second)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func DumpVal(vals ...interface{}) {
|
||||||
|
for _, val := range vals {
|
||||||
|
prettyJSON, err := json.MarshalIndent(val, "", " ")
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
log.Debug(string(prettyJSON))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue