mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-11-23 12:02:58 -05:00
simplify context retrieval
This commit is contained in:
@@ -22,10 +22,7 @@ type Handler struct {
|
||||
}
|
||||
|
||||
func NewHandler(ctx context.Context, config *core.OutboundHandlerConfig) (*Handler, error) {
|
||||
v := core.FromContext(ctx)
|
||||
if v == nil {
|
||||
return nil, newError("V is not in context")
|
||||
}
|
||||
v := core.MustFromContext(ctx)
|
||||
h := &Handler{
|
||||
config: config,
|
||||
outboundManager: v.OutboundHandlerManager(),
|
||||
|
||||
Reference in New Issue
Block a user