I\'d like to parse the response of a web request, but I\'m getting trouble accessing it as string.
func main() { resp, err := http.Get(\"http://google.h
The method you're using to read the http body response returns a byte slice:
func ReadAll(r io.Reader) ([]byte, error)
official documentation
You can convert []byte to a string by using
[]byte
body, err := ioutil.ReadAll(resp.Body) bodyString := string(body)