MCPcopy
hub / github.com/v2ray/v2ray-core / Must2

Function Must2

common/common.go:31–34  ·  view source on GitHub ↗

Must2 panics if the second parameter is not nil, otherwise returns the first parameter.

(v interface{}, err error)

Source from the content-addressed store, hash-verified

29
30// Must2 panics if the second parameter is not nil, otherwise returns the first parameter.
31func Must2(v interface{}, err error) interface{} {
32 Must(err)
33 return v
34}
35
36// Error2 returns the err from the 2nd parameter.
37func Error2(v interface{}, err error) error {

Callers 15

TestV2RayDialFunction · 0.92
TestV2RayDialUDPConnFunction · 0.92
TestV2RayDialUDPFunction · 0.92
initFunction · 0.92
TestPipeCloseFunction · 0.92
TestPipeLimitZeroFunction · 0.92
TestTCPFastOpenFunction · 0.92
TestListenFunction · 0.92
TestListenAbstractFunction · 0.92
TestHTTPConnectionFunction · 0.92
WriteToMethod · 0.92
TestQuicConnectionFunction · 0.92

Calls 1

MustFunction · 0.85

Tested by 15

TestV2RayDialFunction · 0.74
TestV2RayDialUDPConnFunction · 0.74
TestV2RayDialUDPFunction · 0.74
initFunction · 0.74
TestPipeCloseFunction · 0.74
TestPipeLimitZeroFunction · 0.74
TestTCPFastOpenFunction · 0.74
TestListenFunction · 0.74
TestListenAbstractFunction · 0.74
TestHTTPConnectionFunction · 0.74
TestQuicConnectionFunction · 0.74