From 0970fe78a0cdef5468c24fcef4fbe3f9d29ed3cc Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Tue, 30 May 2017 10:30:59 -0700 Subject: [PATCH] vendor: ghodss/yaml v1.0.0 --- cmd/vendor/github.com/ghodss/yaml/fields.go | 6 +++++- cmd/vendor/github.com/ghodss/yaml/yaml.go | 6 +++--- glide.lock | 6 +++--- glide.yaml | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cmd/vendor/github.com/ghodss/yaml/fields.go b/cmd/vendor/github.com/ghodss/yaml/fields.go index 0bd3c2b46..586007402 100644 --- a/cmd/vendor/github.com/ghodss/yaml/fields.go +++ b/cmd/vendor/github.com/ghodss/yaml/fields.go @@ -45,7 +45,11 @@ func indirect(v reflect.Value, decodingNull bool) (json.Unmarshaler, encoding.Te break } if v.IsNil() { - v.Set(reflect.New(v.Type().Elem())) + if v.CanSet() { + v.Set(reflect.New(v.Type().Elem())) + } else { + v = reflect.New(v.Type().Elem()) + } } if v.Type().NumMethod() > 0 { if u, ok := v.Interface().(json.Unmarshaler); ok { diff --git a/cmd/vendor/github.com/ghodss/yaml/yaml.go b/cmd/vendor/github.com/ghodss/yaml/yaml.go index c02beacb9..4fb4054a8 100644 --- a/cmd/vendor/github.com/ghodss/yaml/yaml.go +++ b/cmd/vendor/github.com/ghodss/yaml/yaml.go @@ -15,12 +15,12 @@ import ( func Marshal(o interface{}) ([]byte, error) { j, err := json.Marshal(o) if err != nil { - return nil, fmt.Errorf("error marshaling into JSON: ", err) + return nil, fmt.Errorf("error marshaling into JSON: %v", err) } y, err := JSONToYAML(j) if err != nil { - return nil, fmt.Errorf("error converting JSON to YAML: ", err) + return nil, fmt.Errorf("error converting JSON to YAML: %v", err) } return y, nil @@ -48,7 +48,7 @@ func JSONToYAML(j []byte) ([]byte, error) { var jsonObj interface{} // We are using yaml.Unmarshal here (instead of json.Unmarshal) because the // Go JSON library doesn't try to pick the right number type (int, float, - // etc.) when unmarshling to interface{}, it just picks float64 + // etc.) when unmarshalling to interface{}, it just picks float64 // universally. go-yaml does go through the effort of picking the right // number type, so we can preserve number type throughout this process. err := yaml.Unmarshal(j, &jsonObj) diff --git a/glide.lock b/glide.lock index b3e4f0063..1d866cf7c 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 14e575e5e990839e9e95354d176bd6596d974dbf2f17968775d546fb1e5929be -updated: 2017-05-30T10:25:53.171031047-07:00 +hash: cee1f2629857e9c2384ad89ff6014db09498c9af53771e5144ad3a4b510ff00e +updated: 2017-05-30T10:29:08.22609283-07:00 imports: - name: github.com/beorn7/perks version: 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9 @@ -35,7 +35,7 @@ imports: - name: github.com/dustin/go-humanize version: 8929fe90cee4b2cb9deb468b51fb34eba64d1bf0 - name: github.com/ghodss/yaml - version: 73d445a93680fa1a78ae23a5839bad48f32ba1ee + version: 0ca9ea5df5451ffdf184b4428c902747c2c11cd7 - name: github.com/gogo/protobuf version: 909568be09de550ed094403c2bf8a261b5bb730a subpackages: diff --git a/glide.yaml b/glide.yaml index da89819e9..90bcfeddc 100644 --- a/glide.yaml +++ b/glide.yaml @@ -23,7 +23,7 @@ import: - package: github.com/dustin/go-humanize version: 8929fe90cee4b2cb9deb468b51fb34eba64d1bf0 - package: github.com/ghodss/yaml - version: 73d445a93680fa1a78ae23a5839bad48f32ba1ee + version: v1.0.0 - package: github.com/gogo/protobuf version: v0.3 subpackages: