2016-02-03 16:54:02 -05:00
|
|
|
// Package common contains common utilities that are shared among other packages.
|
|
|
|
// See each sub-package for detail.
|
|
|
|
package common
|
2016-03-09 18:33:01 -05:00
|
|
|
|
2017-04-08 19:43:25 -04:00
|
|
|
//go:generate go run $GOPATH/src/v2ray.com/core/tools/generrorgen/main.go -pkg common -path Common
|
|
|
|
|
2016-12-27 18:53:29 -05:00
|
|
|
// Must panics if err is not nil.
|
|
|
|
func Must(err error) {
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|
2017-09-19 17:27:49 -04:00
|
|
|
|
2017-11-23 04:41:02 -05:00
|
|
|
// Must2 panics if the second parameter is not nil.
|
2017-09-19 17:27:49 -04:00
|
|
|
func Must2(v interface{}, err error) {
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
}
|