v2ray-core/common/common.go

20 lines
458 B
Go
Raw Normal View History

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