fix unmarshaling

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2024-08-02 13:00:46 +02:00
parent 32ee080a3c
commit 1da29fb6fd
2 changed files with 5 additions and 3 deletions
+4 -3
View File
@@ -47,13 +47,14 @@ func (w *Watcher) Next() (*registry.Result, error) {
return nil, errors.New("watcher stopped")
}
var svc *registry.Service
if err := json.Unmarshal(kve.Value.Data, svc); err != nil {
var svc registry.Service
if err := json.Unmarshal(kve.Value.Data, &svc); err != nil {
_ = w.stop()
return nil, err
}
return &registry.Result{
Service: svc,
Service: &svc,
Action: kve.Action,
}, nil
}