mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-09-11 16:46:33 -04:00
remove exported API: toContext
This commit is contained in:
+5
-1
@@ -5,6 +5,7 @@ import (
|
||||
"testing"
|
||||
|
||||
. "github.com/v2fly/v2ray-core/v4"
|
||||
_ "unsafe"
|
||||
)
|
||||
|
||||
func TestFromContextPanic(t *testing.T) {
|
||||
@@ -18,6 +19,9 @@ func TestFromContextPanic(t *testing.T) {
|
||||
MustFromContext(context.Background())
|
||||
}
|
||||
|
||||
//go:linkname mustToContextForced github.com/v2fly/v2ray-core/v4.mustToContext
|
||||
func mustToContextForced(ctx context.Context, v *Instance) context.Context
|
||||
|
||||
func TestToContextPanic(t *testing.T) {
|
||||
defer func() {
|
||||
r := recover()
|
||||
@@ -26,5 +30,5 @@ func TestToContextPanic(t *testing.T) {
|
||||
}
|
||||
}()
|
||||
|
||||
MustToContext(context.Background(), &Instance{})
|
||||
mustToContextForced(context.Background(), &Instance{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user