fixup deps

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-10-02 20:44:00 +03:00
parent 485ad60fe0
commit 81b6c0b3d2

View File

@ -239,16 +239,16 @@ func giteaPullRequest(ctx context.Context, cfg *Config, mods map[string]modules.
req.Header.Add("Accept", "application/json")
req.Header.Add("Content-Type", "application/json")
logger.Infof(ctx, "try to get pulls GET "+envAPIURL+"/repos/"+envREPOSITORY+"/pulls?state=open&token=XXXXXX")
rsp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
if rsp.StatusCode != http.StatusOK {
buf, _ = io.ReadAll(rsp.Body)
if rsp.StatusCode != http.StatusOK {
return fmt.Errorf("unknown error: %s", buf)
}
fmt.Printf("%#+v\n", rsp)
if err = json.Unmarshal(buf, &pulls); err != nil {
logger.Fatalf(ctx, "failed to decode response %s err: %v", buf, err)
}