From f0c66f0b8c482620418966333dbe7ad811fd682c Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Tue, 26 Jan 2016 12:32:50 -0500 Subject: [PATCH] Use reflect.Value.String() rather than a type assertion. Fixes a panic in hashstructure/auditing that can occur with custom string types. Fixes #973 --- audit/hashstructure.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audit/hashstructure.go b/audit/hashstructure.go index 3394ead45..c4e559377 100644 --- a/audit/hashstructure.go +++ b/audit/hashstructure.go @@ -186,7 +186,7 @@ func (w *hashWalker) Primitive(v reflect.Value) error { return nil } - replaceVal := w.Callback(v.Interface().(string)) + replaceVal := w.Callback(v.String()) resultVal := reflect.ValueOf(replaceVal) switch w.loc {