Improved code by updating any interfaces
Change-Id: I9a2e630c37f3c427569f5bbd773978c2705dc08c
diff --git a/service/client.go b/service/client.go
index bdc9d8b..0ea0b94 100644
--- a/service/client.go
+++ b/service/client.go
@@ -139,7 +139,7 @@
}
// Post performs a POST request to the specified endpoint with JSON body
-func (c *Client) Post(ctx context.Context, endpoint string, body interface{}) (*http.Response, error) {
+func (c *Client) Post(ctx context.Context, endpoint string, body any) (*http.Response, error) {
var bodyReader io.Reader
if body != nil {
jsonBody, err := json.Marshal(body)
@@ -153,7 +153,7 @@
}
// GetJSON performs a GET request and unmarshals the JSON response
-func (c *Client) GetJSON(ctx context.Context, endpoint string, target interface{}) error {
+func (c *Client) GetJSON(ctx context.Context, endpoint string, target any) error {
resp, err := c.Get(ctx, endpoint)
if err != nil {
return err
@@ -172,7 +172,7 @@
}
// PostJSON performs a POST request and unmarshals the JSON response
-func (c *Client) PostJSON(ctx context.Context, endpoint string, body interface{}, target interface{}) error {
+func (c *Client) PostJSON(ctx context.Context, endpoint string, body any, target any) error {
resp, err := c.Post(ctx, endpoint, body)
if err != nil {
return err