mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-27 04:25:44 -05:00
simplify context retrieval
This commit is contained in:
@@ -35,11 +35,7 @@ func New(ctx context.Context, config *Config) (*Handler, error) {
|
||||
handler := &Handler{
|
||||
serverList: serverList,
|
||||
serverPicker: protocol.NewRoundRobinServerPicker(serverList),
|
||||
v: core.FromContext(ctx),
|
||||
}
|
||||
|
||||
if handler.v == nil {
|
||||
return nil, newError("V is not in context.")
|
||||
v: core.MustFromContext(ctx),
|
||||
}
|
||||
|
||||
return handler, nil
|
||||
|
||||
Reference in New Issue
Block a user