mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-09-28 21:24:03 -04:00
simplify context retrieval
This commit is contained in:
@@ -18,11 +18,7 @@ type Router struct {
|
||||
}
|
||||
|
||||
func NewRouter(ctx context.Context, config *Config) (*Router, error) {
|
||||
v := core.FromContext(ctx)
|
||||
if v == nil {
|
||||
return nil, newError("V is not in context")
|
||||
}
|
||||
|
||||
v := core.MustFromContext(ctx)
|
||||
r := &Router{
|
||||
domainStrategy: config.DomainStrategy,
|
||||
rules: make([]Rule, len(config.Rule)),
|
||||
|
Reference in New Issue
Block a user