+8
−4
+7
−3
Loading
Use sync.Once for thread-safe lazy initialization of the handler chain in defaultRouter.ServeHTTP, preventing concurrent goroutines from building the chain simultaneously. Also use the server's configured logger in writeJSON instead of slog.Default() for consistency.