func LastPage(res *http.Response) int {
	lastPage := 1
	links := linkheader.Parse(res.Header.Get("Link"))
	for _, link := range links {
		if "last" == link.Rel {
			params := strings.SplitAfter(link.URL, "?")[1]
			if "" != params {
				if values, err := url.ParseQuery(params); nil == err {
					lastPage, _ = strconv.Atoi(values.Get("page"))
				}
			}
		}
	}
	return lastPage
}
// Get last page from response header
Get last page from response header
// Get last page from response header
func LastPage(res *http.Response) int {
	lastPage := 1
	links := linkheader.Parse(res.Header.Get("Link"))
	for _, link := range links {
		if "last" == link.Rel {
			params := strings.SplitAfter(link.URL, "?")[1]
			if "" != params {
				if values, err := url.ParseQuery(params); nil == err {
					lastPage, _ = strconv.Atoi(values.Get("page"))
				}
			}
		}
	}
	return lastPage
}
func LastPage ( res * http . Response ) int { lastPage := 1 links := linkheader . Parse ( res . Header . Get ( " " ) ) for _ , link := range links { if " " == link . Rel { params := strings . SplitAfter ( link . URL , " " ) [ 1 ] if " " != params { if values , err := url . ParseQuery ( params ) ; nil == err { lastPage , _ = strconv . Atoi ( values . Get ( " " ) ) } } } } return lastPage }
Get last page from response header
Get last page from response header