Skip to content

Commit

Permalink
remove func contents
Browse files Browse the repository at this point in the history
Signed-off-by: Johnatas <[email protected]>
  • Loading branch information
johnatasr committed Nov 23, 2023
1 parent 1616d52 commit a8d361f
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions repository/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"net/http"
"os"
"os/exec"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -431,22 +428,3 @@ To find more information on specific steps, please see documentation [here](http
- [ ] QA: Final validation of above PR and tracked through the linked ticket
- [ ] PJM: Close the milestone in GitHub.
`

func ContentByFileNameAndCommit(owner, repo, commitHash, filePath string, httpClient *http.Client) ([]byte, error) {
rawURL := fmt.Sprintf(ghContentURL+"/%s/%s/%s/%s", owner, repo, commitHash, filePath)

response, err := http.Get(rawURL)
if err != nil {
return nil, err
}
defer response.Body.Close()
if response.StatusCode != http.StatusOK {
return nil, errors.New("failed to fetch raw file. status code: " + strconv.Itoa(response.StatusCode))
}
data, err := ioutil.ReadAll(response.Body)
if err != nil {
return nil, err
}

return data, nil
}

0 comments on commit a8d361f

Please sign in to comment.