vendor: update all dependencies

This commit is contained in:
Nick Craig-Wood
2017-07-23 08:51:42 +01:00
parent 0b6fba34a3
commit eb87cf6f12
2008 changed files with 352617 additions and 1004734 deletions
+13
View File
@@ -25,6 +25,7 @@ import (
"reflect"
"sort"
"strings"
"time"
)
// Indent is the string output at each level of indentation.
@@ -58,7 +59,15 @@ type state struct {
defaults bool
}
const maxLevel = 100
var typeOfTime = reflect.TypeOf(time.Time{})
func fprint(w io.Writer, v reflect.Value, s state) {
if s.level > maxLevel {
fmt.Fprintln(w, "pretty: max nested depth exceeded")
return
}
indent := strings.Repeat(Indent, s.level)
fmt.Fprintf(w, "%s%s", indent, s.prefix)
if isNil(v) {
@@ -68,6 +77,10 @@ func fprint(w io.Writer, v reflect.Value, s state) {
if v.Type().Kind() == reflect.Interface {
v = v.Elem()
}
if v.Type() == typeOfTime {
fmt.Fprintf(w, "%s%s", v.Interface(), s.suffix)
return
}
for v.Type().Kind() == reflect.Ptr {
fmt.Fprintf(w, "&")
v = v.Elem()