mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-11-13 04:03:32 -08:00
update Must2
This commit is contained in:
1 file changed
+4
-5
+4
-5
@@ -11,9 +11,8 @@ func Must(err error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Must2 panics if the second parameter is not nil.
|
||||
func Must2(v interface{}, err error) {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
// Must2 panics if the second parameter is not nil, otherwise returns the first parameter.
|
||||
func Must2(v interface{}, err error) interface{} {
|
||||
Must(err)
|
||||
return v
|
||||
}
|
||||
Reference in new issue
Block a user