var b *bytes.Buffer
if a {
b = function()
}

http.NewRequest(`POST`, rawurl, b)

invalid memory address or nil pointer dereference

なんでなん