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:
parent
1107a068b7
commit
f0c66f0b8c
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue