updated slapapi

This commit is contained in:
2026-02-21 14:45:14 +11:00
parent 3dcb864a3e
commit 9b4d78997e
9 changed files with 597 additions and 19 deletions

View File

@@ -2,7 +2,6 @@ package slapshotapi
import (
"context"
"encoding/json"
"fmt"
"strings"
@@ -46,10 +45,9 @@ func (c *SlapAPI) GetSlapID(
}
return 0, errors.Wrap(err, "c.request")
}
resp := idresp{}
err = json.Unmarshal(data, &resp)
resp, err := unmarshal[idresp](data)
if err != nil {
return 0, errors.Wrap(err, "json.Unmarshal")
return 0, errors.Wrap(err, "unmarshal")
}
return resp.ID, nil
}