mirror of
https://github.com/hhftechnology/middleware-manager.git
synced 2026-07-10 00:18:24 +00:00
Add robust error checks and helpers, improve transaction safety, and refine default templates handling. - Add api/handlers/test_helpers_test.go with mustUnmarshalResponse and mustScan helpers and update many handler tests to use them or to check json.Unmarshal errors to fail fast. - Replace direct DB Scan calls in tests with mustScan or explicit error checks to surface query failures. - Improve transaction rollback handling across codepaths (config handlers, database migrations, transaction utils, CertGenerator) to log rollback errors and avoid silent failures. - Make WithTransaction/WithTimeoutTransaction/BatchTransaction formatting consistent and add panic-safe rollback logging. - In main, log a warning instead of ignoring EnsureDefaultDataSources errors. - Add/cleanup various helper blank assignments and small refactors in services (config_proxy, config_generator) and switch tests to shared response writers (writeJSONResponse/writeResponseBody) where applicable. - Large cleanup and enhancements in config/defaults.go to preserve string formatting for YAML templates, ensure special fields are quoted/preserved, and tidy whitespace/formatting. These changes improve test reliability, make DB/tx failures more visible, and ensure default template YAML preserves important string values. |
||
|---|---|---|
| .. | ||
| id_normalizer.go | ||
| id_normalizer_test.go | ||