update github.com/mitchellh/copystructure
Patched a panic where copystructure tries to set an unexported struct field.
This commit is contained in:
parent
98d8440711
commit
403d97183e
|
@ -95,7 +95,9 @@ func (w *walker) Exit(l reflectwalk.Location) error {
|
||||||
if v.IsValid() {
|
if v.IsValid() {
|
||||||
s := w.cs[len(w.cs)-1]
|
s := w.cs[len(w.cs)-1]
|
||||||
sf := reflect.Indirect(s).FieldByName(f.Name)
|
sf := reflect.Indirect(s).FieldByName(f.Name)
|
||||||
sf.Set(v)
|
if sf.CanSet() {
|
||||||
|
sf.Set(v)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case reflectwalk.WalkLoc:
|
case reflectwalk.WalkLoc:
|
||||||
// Clear out the slices for GC
|
// Clear out the slices for GC
|
||||||
|
@ -111,16 +113,12 @@ func (w *walker) Map(m reflect.Value) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the type for the map
|
|
||||||
t := m.Type()
|
|
||||||
mapType := reflect.MapOf(t.Key(), t.Elem())
|
|
||||||
|
|
||||||
// Create the map. If the map itself is nil, then just make a nil map
|
// Create the map. If the map itself is nil, then just make a nil map
|
||||||
var newMap reflect.Value
|
var newMap reflect.Value
|
||||||
if m.IsNil() {
|
if m.IsNil() {
|
||||||
newMap = reflect.Indirect(reflect.New(mapType))
|
newMap = reflect.Indirect(reflect.New(m.Type()))
|
||||||
} else {
|
} else {
|
||||||
newMap = reflect.MakeMap(reflect.MapOf(t.Key(), t.Elem()))
|
newMap = reflect.MakeMap(m.Type())
|
||||||
}
|
}
|
||||||
|
|
||||||
w.cs = append(w.cs, newMap)
|
w.cs = append(w.cs, newMap)
|
||||||
|
|
|
@ -1410,8 +1410,10 @@
|
||||||
"revision": "8631ce90f28644f54aeedcb3e389a85174e067d1"
|
"revision": "8631ce90f28644f54aeedcb3e389a85174e067d1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"checksumSHA1": "86nE93o1VIND0Doe8PuhCXnhUx0=",
|
||||||
"path": "github.com/mitchellh/copystructure",
|
"path": "github.com/mitchellh/copystructure",
|
||||||
"revision": "80adcec1955ee4e97af357c30dee61aadcc02c10"
|
"revision": "cdac8253d00f2ecf0a0b19fbff173a9a72de4f82",
|
||||||
|
"revisionTime": "2016-08-04T03:23:30Z"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "github.com/mitchellh/go-homedir",
|
"path": "github.com/mitchellh/go-homedir",
|
||||||
|
|
Loading…
Reference in New Issue