remove exported API: toContext

This commit is contained in:
Shelikhoo
2021-04-05 18:13:24 +01:00
parent 7731405389
commit d023f68f07
3 changed files with 31 additions and 9 deletions
+5 -1
View File
@@ -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{})
}