vendor: Update everything

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4620
This commit is contained in:
Jakob Borg
2017-12-29 11:38:00 +00:00
parent 1296a22069
commit c24bf7ea55
1070 changed files with 294926 additions and 488191 deletions

View File

@@ -64,9 +64,8 @@ If expected is omited, then the message looks like:
func Message(actual interface{}, message string, expected ...interface{}) string {
if len(expected) == 0 {
return fmt.Sprintf("Expected\n%s\n%s", Object(actual, 1), message)
} else {
return fmt.Sprintf("Expected\n%s\n%s\n%s", Object(actual, 1), message, Object(expected[0], 1))
}
return fmt.Sprintf("Expected\n%s\n%s\n%s", Object(actual, 1), message, Object(expected[0], 1))
}
/*
@@ -124,7 +123,7 @@ func findFirstMismatch(a, b string) int {
bSlice := strings.Split(b, "")
for index, str := range aSlice {
if index > len(b) - 1 {
if index > len(bSlice)-1 {
return index
}
if str != bSlice[index] {
@@ -265,9 +264,8 @@ func formatValue(value reflect.Value, indentation uint) string {
default:
if value.CanInterface() {
return fmt.Sprintf("%#v", value.Interface())
} else {
return fmt.Sprintf("%#v", value)
}
return fmt.Sprintf("%#v", value)
}
}
@@ -311,9 +309,8 @@ func formatSlice(v reflect.Value, indentation uint) string {
if longest > longFormThreshold {
indenter := strings.Repeat(Indent, int(indentation))
return fmt.Sprintf("[\n%s%s,\n%s]", indenter+Indent, strings.Join(result, ",\n"+indenter+Indent), indenter)
} else {
return fmt.Sprintf("[%s]", strings.Join(result, ", "))
}
return fmt.Sprintf("[%s]", strings.Join(result, ", "))
}
func formatMap(v reflect.Value, indentation uint) string {
@@ -332,9 +329,8 @@ func formatMap(v reflect.Value, indentation uint) string {
if longest > longFormThreshold {
indenter := strings.Repeat(Indent, int(indentation))
return fmt.Sprintf("{\n%s%s,\n%s}", indenter+Indent, strings.Join(result, ",\n"+indenter+Indent), indenter)
} else {
return fmt.Sprintf("{%s}", strings.Join(result, ", "))
}
return fmt.Sprintf("{%s}", strings.Join(result, ", "))
}
func formatStruct(v reflect.Value, indentation uint) string {
@@ -355,9 +351,8 @@ func formatStruct(v reflect.Value, indentation uint) string {
if longest > longFormThreshold {
indenter := strings.Repeat(Indent, int(indentation))
return fmt.Sprintf("{\n%s%s,\n%s}", indenter+Indent, strings.Join(result, ",\n"+indenter+Indent), indenter)
} else {
return fmt.Sprintf("{%s}", strings.Join(result, ", "))
}
return fmt.Sprintf("{%s}", strings.Join(result, ", "))
}
func isNilValue(a reflect.Value) bool {