Skip to content

Commit a07e4e6

Browse files
committed
fix: address PR review notes
1 parent 2adbaa9 commit a07e4e6

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

examples/hello-mysql/internal/httpserver/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func BuildAppHandler(opts app.Options) (*kernel.App, http.Handler, error) {
2222
router := modkithttp.NewRouter()
2323
router.Use(modkithttp.RequestLogger(logger))
2424
if err := modkithttp.RegisterRoutes(modkithttp.AsRouter(router), boot.Controllers); err != nil {
25-
return nil, nil, err
25+
return boot, nil, err
2626
}
2727
router.Get("/swagger/*", httpSwagger.WrapHandler)
2828
router.Get("/docs/*", httpSwagger.WrapHandler)

examples/hello-mysql/internal/lifecycle/cleanup.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ type shutdowner interface {
4545
func ShutdownServer(ctx context.Context, server shutdowner, hooks []CleanupHook) error {
4646
shutdownErr := server.Shutdown(ctx)
4747
cleanupErr := RunCleanup(ctx, hooks)
48+
if shutdownErr != nil && cleanupErr != nil {
49+
return errors.Join(shutdownErr, cleanupErr)
50+
}
4851
if shutdownErr != nil {
4952
return shutdownErr
5053
}

modkit/kernel/bootstrap_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ func TestBootstrapRejectsDuplicateControllerNames(t *testing.T) {
178178
}
179179

180180
func TestBootstrap_CollectsCleanupHooksInLIFO(t *testing.T) {
181-
tokenB := module.Token("token-b")
182-
tokenA := module.Token("token-a")
181+
tokenB := module.Token("test.tokenB")
182+
tokenA := module.Token("test.tokenA")
183183
calls := make([]string, 0, 2)
184184

185185
modA := mod("A", nil,

0 commit comments

Comments
 (0)