mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 10:08:15 -05:00
update Must2
This commit is contained in:
parent
88b25d38cb
commit
098244530b
@ -11,9 +11,8 @@ func Must(err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Must2 panics if the second parameter is not nil.
|
// Must2 panics if the second parameter is not nil, otherwise returns the first parameter.
|
||||||
func Must2(v interface{}, err error) {
|
func Must2(v interface{}, err error) interface{} {
|
||||||
if err != nil {
|
Must(err)
|
||||||
panic(err)
|
return v
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user