mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-09-27 20:54:04 -04:00
simplify context retrieval
This commit is contained in:
@@ -27,10 +27,7 @@ type Server struct {
|
||||
func NewServer(ctx context.Context, config *ServerConfig) (*Server, error) {
|
||||
s := &Server{
|
||||
config: config,
|
||||
v: core.FromContext(ctx),
|
||||
}
|
||||
if s.v == nil {
|
||||
return nil, newError("V is not in context.")
|
||||
v: core.MustFromContext(ctx),
|
||||
}
|
||||
return s, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user