Skip to content

Commit 0fc382f

Browse files
authored
Update README.md
1 parent a6271be commit 0fc382f

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

README.md

+13-5
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@ package main
1313

1414
import (
1515
"context"
16-
"github.com/microsoft/azure-devops-go-api/azuredevops"
17-
"github.com/microsoft/azure-devops-go-api/azuredevops/core"
1816
"log"
17+
"strconv"
18+
19+
"github.com/microsoft/azure-devops-go-api/azuredevops/v7"
20+
"github.com/microsoft/azure-devops-go-api/azuredevops/v7/core"
1921
)
2022

2123
func main() {
22-
organizationUrl := "https://dev.azure.com/myorg" // todo: replace value with your organization url
23-
personalAccessToken := "XXXXXXXXXXXXXXXXXXXXXXX" // todo: replace value with your PAT
24+
organizationUrl := "https://dev.azure.com/myorg" // todo: replace value with your organization url
25+
personalAccessToken := "XXXXXXXXXXXXXXXXXXXXXXX" // todo: replace value with your PAT
2426

2527
// Create a connection to your organization
2628
connection := azuredevops.NewPatConnection(organizationUrl, personalAccessToken)
@@ -49,9 +51,15 @@ func main() {
4951

5052
// if continuationToken has a value, then there is at least one more page of projects to get
5153
if responseValue.ContinuationToken != "" {
54+
55+
continuationToken, err := strconv.Atoi(responseValue.ContinuationToken)
56+
if err != nil {
57+
log.Fatal(err)
58+
}
59+
5260
// Get next page of team projects
5361
projectArgs := core.GetProjectsArgs{
54-
ContinuationToken: &responseValue.ContinuationToken,
62+
ContinuationToken: &continuationToken,
5563
}
5664
responseValue, err = coreClient.GetProjects(ctx, projectArgs)
5765
if err != nil {

0 commit comments

Comments
 (0)