// Create a new GET request req, err := http.NewRequest("GET", "http://example.com", nil) if err != nil { // handle error } // Add headers to the request req.Header.Add("Authorization", "Bearer my-token") req.Header.Add("Content-Type", "application/json") // Set basic authentication credentials req.SetBasicAuth("username", "password") // Send the request using an HTTP client resp, err := http.DefaultClient.Do(req) if err != nil { // handle error } defer resp.Body.Close() // Get the response body as a byte slice body, err := ioutil.ReadAll(resp.Body) if err != nil { // handle error }In this example, we create a new GET request to the example.com URL, add headers and authentication credentials, and then send the request using the DefaultClient in the net/http package. We then read the response body using the ioutil package's ReadAll function and store it in a byte slice. The net/http package is the package library used in these examples.