Skip to content

Commit

Permalink
delete unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
vm-001 committed Dec 12, 2024
1 parent 2762736 commit 1dcc7a3
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions cmd/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ package cmd

import (
"fmt"
"io"
"net/http"
"strings"
"time"
)

var ANSWERS = map[string]bool{
Expand All @@ -21,25 +18,3 @@ func prompt(q string) bool {
_, _ = fmt.Scan(&answer)
return ANSWERS[strings.ToLower(answer)]
}

func sendHTTPRequest(req *http.Request, timeout time.Duration) (string, error) {
client := http.Client{
Timeout: timeout,
}
resp, err := client.Do(req)
if err != nil {
return "", err
}

b, err := io.ReadAll(resp.Body)
if err != nil {
return "", err
}
defer resp.Body.Close()

if resp.StatusCode != http.StatusOK {
return "", fmt.Errorf("invalid status code: %d %s", resp.StatusCode, string(b))
}

return string(b), nil
}

0 comments on commit 1dcc7a3

Please sign in to comment.