Browse Source

update Must2

pull/876/head
Darien Raymond 7 years ago
parent
commit
098244530b
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
  1. 9
      common/common.go

9
common/common.go

@ -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
}

Loading…
Cancel
Save