mirror of
https://github.com/mainnika/mongox-go-driver.git
synced 2026-05-22 15:53:36 +00:00
Use err type for panics
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user