Use reflect.Value.String() rather than a type assertion.

Fixes a panic in hashstructure/auditing that can occur with custom
string types.

Fixes #973
This commit is contained in:
Jeff Mitchell 2016-01-26 12:32:50 -05:00
parent 1107a068b7
commit f0c66f0b8c
1 changed files with 1 additions and 1 deletions

View File

@ -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 {