Update go dependencies and cleanup deprecated packages

This commit is contained in:
Manuel de Brito Fontes 2018-01-07 12:10:25 -03:00
parent 03a1e20fde
commit 44fd79d061
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
1099 changed files with 75691 additions and 31913 deletions

View file

@ -9,11 +9,13 @@ load(
go_library(
name = "go_default_library",
srcs = ["fields.go"],
importpath = "k8s.io/apimachinery/third_party/forked/golang/json",
)
go_test(
name = "go_default_test",
srcs = ["fields_test.go"],
importpath = "k8s.io/apimachinery/third_party/forked/golang/json",
library = ":go_default_library",
)

View file

@ -26,17 +26,14 @@ const (
// struct field given the struct type and the JSON name of the field.
// It returns field type, a slice of patch strategies, merge key and error.
// TODO: fix the returned errors to be introspectable.
func LookupPatchMetadata(t reflect.Type, jsonField string) (
func LookupPatchMetadataForStruct(t reflect.Type, jsonField string) (
elemType reflect.Type, patchStrategies []string, patchMergeKey string, e error) {
if t.Kind() == reflect.Ptr {
t = t.Elem()
}
if t.Kind() == reflect.Map {
elemType = t.Elem()
return
}
if t.Kind() != reflect.Struct {
e = fmt.Errorf("merging an object in json but data type is not map or struct, instead is: %s",
e = fmt.Errorf("merging an object in json but data type is not struct, instead is: %s",
t.Kind().String())
return
}

View file

@ -14,7 +14,7 @@ func TestLookupPtrToStruct(t *testing.T) {
Inner []Elem `json:"inner" patchStrategy:"merge" patchMergeKey:"key"`
}
outer := &Outer{}
elemType, patchStrategies, patchMergeKey, err := LookupPatchMetadata(reflect.TypeOf(outer), "inner")
elemType, patchStrategies, patchMergeKey, err := LookupPatchMetadataForStruct(reflect.TypeOf(outer), "inner")
if err != nil {
t.Fatal(err)
}

View file

@ -8,6 +8,7 @@ load(
go_library(
name = "go_default_library",
srcs = ["addr.go"],
importpath = "k8s.io/apimachinery/third_party/forked/golang/netutil",
)
filegroup(

View file

@ -9,12 +9,14 @@ load(
go_test(
name = "go_default_test",
srcs = ["deep_equal_test.go"],
importpath = "k8s.io/apimachinery/third_party/forked/golang/reflect",
library = ":go_default_library",
)
go_library(
name = "go_default_library",
srcs = ["deep_equal.go"],
importpath = "k8s.io/apimachinery/third_party/forked/golang/reflect",
)
filegroup(