mirror of
https://github.com/restic/restic.git
synced 2026-08-02 20:22:17 +00:00
Update dependencies
Among others, this updates minio-go, so that the new "eu-west-3" zone for AWS is supported.
This commit is contained in:
+12
-15
@@ -19,7 +19,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@@ -75,9 +74,10 @@ var intType = reflect.TypeOf(int(0))
|
||||
|
||||
func field(name string, tval interface{}, index ...int) *Field {
|
||||
return &Field{
|
||||
Name: name,
|
||||
Type: reflect.TypeOf(tval),
|
||||
Index: index,
|
||||
Name: name,
|
||||
Type: reflect.TypeOf(tval),
|
||||
Index: index,
|
||||
ParsedTag: []string(nil),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ func tfield(name string, tval interface{}, index ...int) *Field {
|
||||
Type: reflect.TypeOf(tval),
|
||||
Index: index,
|
||||
NameFromTag: true,
|
||||
ParsedTag: []string(nil),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,6 +104,9 @@ func TestFieldsNoTags(t *testing.T) {
|
||||
field("Em4", int(0), 4, 2, 0),
|
||||
field("Anonymous", Anonymous(0), 5),
|
||||
}
|
||||
for _, f := range want {
|
||||
f.ParsedTag = nil
|
||||
}
|
||||
if msg, ok := compareFields(got, want); !ok {
|
||||
t.Error(msg)
|
||||
}
|
||||
@@ -138,9 +142,10 @@ func TestAgainstJSONEncodingNoTags(t *testing.T) {
|
||||
Anonymous: Anonymous(15),
|
||||
}
|
||||
var want S1
|
||||
want.embed2 = &embed2{} // need this because reflection won't create it
|
||||
jsonRoundTrip(t, s1, &want)
|
||||
var got S1
|
||||
got.embed2 = &embed2{} // need this because reflection won't create it
|
||||
got.embed2 = &embed2{}
|
||||
fields, err := NewCache(nil, nil, nil).Fields(reflect.TypeOf(got))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
@@ -204,15 +209,7 @@ type tEmbed2 struct {
|
||||
}
|
||||
|
||||
func jsonTagParser(t reflect.StructTag) (name string, keep bool, other interface{}, err error) {
|
||||
s := t.Get("json")
|
||||
parts := strings.Split(s, ",")
|
||||
if parts[0] == "-" {
|
||||
return "", false, nil, nil
|
||||
}
|
||||
if len(parts) > 1 {
|
||||
other = parts[1:]
|
||||
}
|
||||
return parts[0], true, other, nil
|
||||
return ParseStandardTag("json", t)
|
||||
}
|
||||
|
||||
func validateFunc(t reflect.Type) (err error) {
|
||||
@@ -408,7 +405,7 @@ func compareFields(got []Field, want []*Field) (msg string, ok bool) {
|
||||
for i, g := range got {
|
||||
w := *want[i]
|
||||
if !fieldsEqual(&g, &w) {
|
||||
return fmt.Sprintf("got %+v, want %+v", g, w), false
|
||||
return fmt.Sprintf("got\n%+v\nwant\n%+v", g, w), false
|
||||
}
|
||||
}
|
||||
return "", true
|
||||
|
||||
Reference in New Issue
Block a user