chore: stabilize lint and verify builds

This commit is contained in:
2026-02-06 11:51:32 +08:00
parent edede17880
commit 1782f64417
114 changed files with 3032 additions and 1345 deletions

View File

@@ -17,20 +17,21 @@ func Provide(opts ...opt.Option) error {
if err := o.UnmarshalConfig(&config); err != nil {
return err
}
return container.Container.Provide(func(http *http.Service, grpc *grpc.Grpc) (*CMux, error) {
l, err := net.Listen("tcp", config.Address())
return container.Container.Provide(func(httpSvc *http.Service, grpcSvc *grpc.Grpc) (*CMux, error) {
listener, err := net.Listen("tcp", config.Address())
if err != nil {
return nil, err
}
mux := &CMux{
Http: http,
Grpc: grpc,
Mux: cmux.New(l),
Base: l,
HTTP: httpSvc,
Grpc: grpcSvc,
Mux: cmux.New(listener),
Base: listener,
}
// Ensure cmux stops accepting new connections on shutdown
container.AddCloseAble(func() { _ = l.Close() })
container.AddCloseAble(func() { _ = listener.Close() })
return mux, nil
}, o.DiOptions()...)