I am doing an http request
like this one:
resp, err := http.Get("http://example.com/")
Then I am getting the header link
:
link := resp.Header.Get("link")
Which gives me a result like this:
<page=3>; rel="next",<page=1>; rel="prev";<page=5>; rel="last"
Question
How can I parse this into a more legible way? I specifically trying to get the last
page but first
and next
page should useful as well.
I tried with Splits
and Regular expressions
without success.