fix: json marshaling

This commit is contained in:
yusing
2025-04-26 01:31:22 +08:00
parent db6fc65876
commit 03d609e4e1
8 changed files with 28 additions and 22 deletions

View File

@@ -102,8 +102,8 @@ func checkUpdateState(key string) (w *Watcher, ready bool, err error) {
return w, false, nil
}
// MarshalMap implements health.HealthMonitor.
func (w *Watcher) MarshalMap() map[string]any {
// MarshalJSON implements health.HealthMonitor.
func (w *Watcher) MarshalJSON() ([]byte, error) {
url := w.hc.URL()
if url.Port() == "0" {
url = nil
@@ -118,5 +118,5 @@ func (w *Watcher) MarshalMap() map[string]any {
Config: dummyHealthCheckConfig,
URL: url,
Detail: detail,
}).MarshalMap()
}).MarshalJSON()
}