title: Cycling through API responses to get multiple pages
body: <p>this is my code:</p>
  <pre><code>func nextpage(id int, currentpage string) string {
      response, err := http.Get(fmt.Sprintf(&quot;https://groups.roblox.com/v1/groups/%d/users?sortOrder=Asc&amp;limit=100&amp;cursor=%s&quot;, id, currentpage))
      if err != nil {
          panic(err)
      }
      defer response.Body.Close()
      var getcursor *gus
      error := json.NewDecoder(response.Body).Decode(&amp;getcursor)
      if error != nil {
          fmt.Println(error)
      }
      return getcursor.Nextpagecursor
  }
  
  func cycle(id int) string {
      secondpage := nextpage(id, &quot;&quot;)
      thirdpage := nextpage(id, secondpage)
      fourthpage := nextpage(id, thirdpage)
  
      return secondpage
  }
  </code></pre>
  <p>what this does:</p>
  <p>it send a request to <a href="https://groups.roblox.com/v1/groups/2/users?sortOrder=Asc&amp;limit=100&amp;cursor=" rel="nofollow noreferrer">https://groups.roblox.com/v1/groups/2/users?sortOrder=Asc&amp;limit=100&amp;cursor=</a></p>
  <p>then it returns the <strong>nextpagecursor</strong> of the response that gives.</p>
  <p>then i try to cycle through the pages with the last function named <strong>cycle</strong></p>
  <p>but i don't know how to make it work to give me every <strong>nextpagecursor</strong> so i can get data from every page.</p>