In below code snippet I parse http response body 'b' to func parseGoQuery and it is ok first time, but when I do it second time in main() it shows me that response 'b' is 0 inside func parseGoQuery. I think I pass copy of variable 'b' , not pointer, I am confused...please advice
resp, _ := client.Get(URL)
b :=resp.Body
defer b.Close() // close Body when the function returns
parseGoQuery("tag1", b) //b is not 0 as expected, good
parseGoQuery("tag2", b) //b is 0 !!!???
Here is func parseGoQuery
func parseGoQuery(tag string, b io.Reader) {
fmt.Println(tag,b)
//skipped
}