client-inspect

Allows inspection of a http.Client connections
Heavily based on github.com/j0hnsmith/connspy
http package
A http.Client suitable for debugging, writes all http data to stdout.
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"regexp"
"strings"
clientInspect "github.com/petems/client-inspect/http"
)
func main() {
client := clientInspect.NewClient(nil, nil)
resp, _ := client.Get("http://example.com/")
// ensure all of the body is read
ioutil.ReadAll(resp.Body)
resp.Body.Close()
resp, _ = client.Get("https://example.com/")
ioutil.ReadAll(resp.Body)
resp.Body.Close()
}

You can also specify the writer with http.NewClientWriter, which can be used to do things like redact certain fields:
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"regexp"
"strings"
clientInspect "github.com/petems/client-inspect/http"
)
func main() {
buf := new(bytes.Buffer)
client := http.NewClientWriter(nil, nil, buf)
resp, _ := client.Get("http://example.com/")
// ensure all of the body is read
ioutil.ReadAll(resp.Body)
resp.Body.Close()
resp, _ = client.Get("https://example.com/")
ioutil.ReadAll(resp.Body)
resp.Body.Close()
httpLog := buf.String()
s := strings.Split(httpLog, "\n")
for count, line := range s {
rgx := regexp.MustCompile(`^(Host: )(.+)$`)
line = rgx.ReplaceAllString(line, `$1[REDACTED]`)
s[count] = line
}
fmt.Println(s)
}

Background info
https://medium.com/@j0hnsmith/eavesdrop-on-a-golang-http-client-c4dc49af9d5e