Use err type for panics

This commit is contained in:
Nikita Tokarchuk
2020-07-13 02:42:24 +02:00
parent 72e74a65b6
commit 1d3e29fe10
2 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
package base
import (
"fmt"
"reflect"
)
@@ -19,7 +20,7 @@ func Reset(target interface{}) {
v := reflect.ValueOf(target)
if v.Kind() != reflect.Ptr {
panic("reset target should be a pointer")
panic(fmt.Errorf("reset target should be a pointer"))
}
t := v.Elem().Type()