mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-07-17 13:21:06 +03:00
Add xhttp transport
This commit is contained in:
19
common/xray/common.go
Normal file
19
common/xray/common.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package common
|
||||
|
||||
// Must panics if err is not nil.
|
||||
func Must(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
|
||||
}
|
||||
|
||||
// Error2 returns the err from the 2nd parameter.
|
||||
func Error2(v interface{}, err error) error {
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user