code: func ParseWebLinks(response *http.Response) WebLinks {
  	wls := WebLinks{}
  
  	if links, ok := response.Header["Link"]; ok && len(links) > 0 {
  		for _, lnk := range links {
  			for _, link := range strings.Split(lnk, ",") {
  				segments := strings.Split(strings.TrimSpace(link), ";")
  
  				// link must at least have href and rel
  				if len(segments) < 2 {
  					continue
  				}
  
  				// ensure href is properly formatted
  				if !strings.HasPrefix(segments[0], "<") || !strings.HasSuffix(segments[0], ">") {
  					continue
  				}
  
  				// try to pull out page parameter
  				link, err := url.Parse(segments[0][1 : len(segments[0])-1])
  				if err != nil {
  					continue
  				}
  
  				for _, segment := range segments[1:] {
  					switch strings.TrimSpace(segment) {
  					case `rel="next"`:
  						wls.NextPage = link.String()
  					case `rel="prev"`:
  						wls.PrevPage = link.String()
  					case `rel="first"`:
  						wls.FirstPage = link.String()
  					case `rel="last"`:
  						wls.LastPage = link.String()
  					}
  
  				}
  			}
  		}
  	}
  
  	return wls
  }
docs: // ParseWebLinks partially implements RFC 8288 parsing, enough to support
  // GitHub pagination links. See https://tools.ietf.org/html/rfc8288 for more
  // details on Web Linking and https://github.com/google/go-github for the API
  // client that this function was original extracted from.
  //
  // Link headers typically look like:
  //
  //   Link: <https://api.github.com/user/teams?page=2>; rel="next",
  //     <https://api.github.com/user/teams?page=34>; rel="last"