From 403d97183ef3fe1a8b50cc393c28981b3485b7dc Mon Sep 17 00:00:00 2001 From: James Bardin Date: Thu, 4 Aug 2016 11:23:59 -0400 Subject: [PATCH] update github.com/mitchellh/copystructure Patched a panic where copystructure tries to set an unexported struct field. --- .../mitchellh/copystructure/copystructure.go | 12 +++++------- vendor/vendor.json | 4 +++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/vendor/github.com/mitchellh/copystructure/copystructure.go b/vendor/github.com/mitchellh/copystructure/copystructure.go index 7ef83d8aa..98c5144e2 100644 --- a/vendor/github.com/mitchellh/copystructure/copystructure.go +++ b/vendor/github.com/mitchellh/copystructure/copystructure.go @@ -95,7 +95,9 @@ func (w *walker) Exit(l reflectwalk.Location) error { if v.IsValid() { s := w.cs[len(w.cs)-1] sf := reflect.Indirect(s).FieldByName(f.Name) - sf.Set(v) + if sf.CanSet() { + sf.Set(v) + } } case reflectwalk.WalkLoc: // Clear out the slices for GC @@ -111,16 +113,12 @@ func (w *walker) Map(m reflect.Value) error { 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 var newMap reflect.Value if m.IsNil() { - newMap = reflect.Indirect(reflect.New(mapType)) + newMap = reflect.Indirect(reflect.New(m.Type())) } else { - newMap = reflect.MakeMap(reflect.MapOf(t.Key(), t.Elem())) + newMap = reflect.MakeMap(m.Type()) } w.cs = append(w.cs, newMap) diff --git a/vendor/vendor.json b/vendor/vendor.json index 9931fb9d8..ee31a419f 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -1410,8 +1410,10 @@ "revision": "8631ce90f28644f54aeedcb3e389a85174e067d1" }, { + "checksumSHA1": "86nE93o1VIND0Doe8PuhCXnhUx0=", "path": "github.com/mitchellh/copystructure", - "revision": "80adcec1955ee4e97af357c30dee61aadcc02c10" + "revision": "cdac8253d00f2ecf0a0b19fbff173a9a72de4f82", + "revisionTime": "2016-08-04T03:23:30Z" }, { "path": "github.com/mitchellh/go-homedir",