Err support nil
This commit is contained in:
parent
1a7cdbad3f
commit
77e7e7d3fb
3
gojs.go
3
gojs.go
@ -105,6 +105,9 @@ func Errf(format string, args ...any) *common.GoErr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Err(err any) *common.GoErr {
|
func Err(err any) *common.GoErr {
|
||||||
|
if err == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
errStr := ""
|
errStr := ""
|
||||||
if e, ok := err.(error); ok {
|
if e, ok := err.(error); ok {
|
||||||
errStr = e.Error()
|
errStr = e.Error()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user