You've already forked v2ray-core
simplify context retrieval
This commit is contained in:
@@ -139,10 +139,7 @@ func (s *service) Register(server *grpc.Server) {
|
||||
|
||||
func init() {
|
||||
common.Must(common.RegisterConfig((*Config)(nil), func(ctx context.Context, cfg interface{}) (interface{}, error) {
|
||||
s := core.FromContext(ctx)
|
||||
if s == nil {
|
||||
return nil, newError("V is not in context.")
|
||||
}
|
||||
s := core.MustFromContext(ctx)
|
||||
return &service{v: s}, nil
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user