mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-25 11:35:34 -05:00
simplify context retrieval
This commit is contained in:
@@ -31,10 +31,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