Browse Source

use correct function for to context

Shelikhoo 4 years ago
parent
commit
03b0c8efd9
1 changed files with 4 additions and 4 deletions
  1. 4 4
      app/proxyman/outbound/handler_test.go

+ 4 - 4
app/proxyman/outbound/handler_test.go

@@ -22,8 +22,8 @@ func TestInterfaces(t *testing.T) {
 	_ = (outbound.Manager)(new(Manager))
 	_ = (outbound.Manager)(new(Manager))
 }
 }
 
 
-//go:linkname mustToContextForced github.com/v2fly/v2ray-core/v4.mustToContext
-func mustToContextForced(ctx context.Context, v *core.Instance) context.Context
+//go:linkname toContext github.com/v2fly/v2ray-core/v4.toContext
+func toContext(ctx context.Context, v *core.Instance) context.Context
 
 
 func TestOutboundWithoutStatCounter(t *testing.T) {
 func TestOutboundWithoutStatCounter(t *testing.T) {
 	config := &core.Config{
 	config := &core.Config{
@@ -41,7 +41,7 @@ func TestOutboundWithoutStatCounter(t *testing.T) {
 
 
 	v, _ := core.New(config)
 	v, _ := core.New(config)
 	v.AddFeature((outbound.Manager)(new(Manager)))
 	v.AddFeature((outbound.Manager)(new(Manager)))
-	ctx := mustToContextForced(context.Background(), v)
+	ctx := toContext(context.Background(), v)
 	h, _ := NewHandler(ctx, &core.OutboundHandlerConfig{
 	h, _ := NewHandler(ctx, &core.OutboundHandlerConfig{
 		Tag:           "tag",
 		Tag:           "tag",
 		ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
 		ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
@@ -70,7 +70,7 @@ func TestOutboundWithStatCounter(t *testing.T) {
 
 
 	v, _ := core.New(config)
 	v, _ := core.New(config)
 	v.AddFeature((outbound.Manager)(new(Manager)))
 	v.AddFeature((outbound.Manager)(new(Manager)))
-	ctx := mustToContextForced(context.Background(), v)
+	ctx := toContext(context.Background(), v)
 	h, _ := NewHandler(ctx, &core.OutboundHandlerConfig{
 	h, _ := NewHandler(ctx, &core.OutboundHandlerConfig{
 		Tag:           "tag",
 		Tag:           "tag",
 		ProxySettings: serial.ToTypedMessage(&freedom.Config{}),
 		ProxySettings: serial.ToTypedMessage(&freedom.Config{}),