Skip to content

Commit

Permalink
refactor: remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFirmo committed Sep 28, 2023
1 parent 85e2e13 commit a34a2d3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion internal/gorest/gorest.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ func CreateApp() *App {
requestsList: reqList,
}

// Configure root layout
a.rootContainer.AddItem(a.requestsList.Container, 0, 1, true).
AddItem(a.request.Container, 0, 2, false).
AddItem(a.response.Container, 0, 2, false)
Expand Down
6 changes: 0 additions & 6 deletions internal/utils/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,26 @@ import (
)

func MakeRequest(url string) ([]byte, error) {
// Create a new HTTP client.
client := &http.Client{}

// Make a GET request to the Google homepage.
res, err := client.Get(url)
if err != nil {
return nil, err
}

// Close the response body when we're done with it.
defer res.Body.Close()

// Read the response body into a byte array.
bytes, err := io.ReadAll(res.Body)
if err != nil {
return nil, err
}

// Create a map or struct to unmarshal the JSON data
var jsonData interface{}
err = json.Unmarshal(bytes, &jsonData)
if err != nil {
return nil, err
}

// Marshal the JSON data with indentation
indentedJSON, err := json.MarshalIndent(jsonData, "", " ")
if err != nil {
return nil, err
Expand Down

0 comments on commit a34a2d3

Please sign in to comment.