* 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]>
20 lines
383 B
Go
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
|
|
}
|