vendor: ghodss/yaml v1.0.0
This commit is contained in:
4
cmd/vendor/github.com/ghodss/yaml/fields.go
generated
vendored
4
cmd/vendor/github.com/ghodss/yaml/fields.go
generated
vendored
@ -45,7 +45,11 @@ func indirect(v reflect.Value, decodingNull bool) (json.Unmarshaler, encoding.Te
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
if v.IsNil() {
|
if v.IsNil() {
|
||||||
|
if v.CanSet() {
|
||||||
v.Set(reflect.New(v.Type().Elem()))
|
v.Set(reflect.New(v.Type().Elem()))
|
||||||
|
} else {
|
||||||
|
v = reflect.New(v.Type().Elem())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if v.Type().NumMethod() > 0 {
|
if v.Type().NumMethod() > 0 {
|
||||||
if u, ok := v.Interface().(json.Unmarshaler); ok {
|
if u, ok := v.Interface().(json.Unmarshaler); ok {
|
||||||
|
6
cmd/vendor/github.com/ghodss/yaml/yaml.go
generated
vendored
6
cmd/vendor/github.com/ghodss/yaml/yaml.go
generated
vendored
@ -15,12 +15,12 @@ import (
|
|||||||
func Marshal(o interface{}) ([]byte, error) {
|
func Marshal(o interface{}) ([]byte, error) {
|
||||||
j, err := json.Marshal(o)
|
j, err := json.Marshal(o)
|
||||||
if err != nil {
|
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)
|
y, err := JSONToYAML(j)
|
||||||
if err != nil {
|
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
|
return y, nil
|
||||||
@ -48,7 +48,7 @@ func JSONToYAML(j []byte) ([]byte, error) {
|
|||||||
var jsonObj interface{}
|
var jsonObj interface{}
|
||||||
// We are using yaml.Unmarshal here (instead of json.Unmarshal) because the
|
// 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,
|
// 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
|
// universally. go-yaml does go through the effort of picking the right
|
||||||
// number type, so we can preserve number type throughout this process.
|
// number type, so we can preserve number type throughout this process.
|
||||||
err := yaml.Unmarshal(j, &jsonObj)
|
err := yaml.Unmarshal(j, &jsonObj)
|
||||||
|
6
glide.lock
generated
6
glide.lock
generated
@ -1,5 +1,5 @@
|
|||||||
hash: 14e575e5e990839e9e95354d176bd6596d974dbf2f17968775d546fb1e5929be
|
hash: cee1f2629857e9c2384ad89ff6014db09498c9af53771e5144ad3a4b510ff00e
|
||||||
updated: 2017-05-30T10:25:53.171031047-07:00
|
updated: 2017-05-30T10:29:08.22609283-07:00
|
||||||
imports:
|
imports:
|
||||||
- name: github.com/beorn7/perks
|
- name: github.com/beorn7/perks
|
||||||
version: 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9
|
version: 4c0e84591b9aa9e6dcfdf3e020114cd81f89d5f9
|
||||||
@ -35,7 +35,7 @@ imports:
|
|||||||
- name: github.com/dustin/go-humanize
|
- name: github.com/dustin/go-humanize
|
||||||
version: 8929fe90cee4b2cb9deb468b51fb34eba64d1bf0
|
version: 8929fe90cee4b2cb9deb468b51fb34eba64d1bf0
|
||||||
- name: github.com/ghodss/yaml
|
- name: github.com/ghodss/yaml
|
||||||
version: 73d445a93680fa1a78ae23a5839bad48f32ba1ee
|
version: 0ca9ea5df5451ffdf184b4428c902747c2c11cd7
|
||||||
- name: github.com/gogo/protobuf
|
- name: github.com/gogo/protobuf
|
||||||
version: 909568be09de550ed094403c2bf8a261b5bb730a
|
version: 909568be09de550ed094403c2bf8a261b5bb730a
|
||||||
subpackages:
|
subpackages:
|
||||||
|
@ -23,7 +23,7 @@ import:
|
|||||||
- package: github.com/dustin/go-humanize
|
- package: github.com/dustin/go-humanize
|
||||||
version: 8929fe90cee4b2cb9deb468b51fb34eba64d1bf0
|
version: 8929fe90cee4b2cb9deb468b51fb34eba64d1bf0
|
||||||
- package: github.com/ghodss/yaml
|
- package: github.com/ghodss/yaml
|
||||||
version: 73d445a93680fa1a78ae23a5839bad48f32ba1ee
|
version: v1.0.0
|
||||||
- package: github.com/gogo/protobuf
|
- package: github.com/gogo/protobuf
|
||||||
version: v0.3
|
version: v0.3
|
||||||
subpackages:
|
subpackages:
|
||||||
|
Reference in New Issue
Block a user