Files
Nabeel AlamandKashif Khan b2ba219e24 [Feat] Added Figma (PAT) Analyzer (#3974)
* added figma analyzer

* fixed lint issue

* fixed lint issue (2)

* added endpoint config from json

* simplified scope extraction and endpoint configuration

* updated with lint issue fixes

---------

Co-authored-by: Kashif Khan <[email protected]>
2025-04-03 19:14:48 +05:00

20 lines
383 B
Go

package figma
import (
"net/http"
)
func callAPIEndpoint(client *http.Client, token string, endpoint endpoint) (*http.Response, error) {
req, err := http.NewRequest(endpoint.Method, endpoint.URL, nil)
if err != nil {
return nil, err
}
req.Header.Set("X-FIGMA-TOKEN", token)
resp, err := http.DefaultClient.Do(req)
if err != nil {
return nil, err
}
return resp, nil
}