1steps:
2  # steps after this one (and in the same job) will have access to the variable
3  # GO_WORKSPACE_PATH
4  # GO_PATH
5  # all further steps should utilize these values through $(GO_PATH) or $(GO_WORKSPACE_PATH)
6  - pwsh: |
7      $target = "$(Build.SourcesDirectory)/../go"
8      $createdWorkspaceInfo = (./eng/scripts/create_go_workspace.ps1 -goWorkSpaceDir $target)
9
10      # set the output variables for further jobs.
11      Write-Host "##vso[task.setvariable variable=GOPATH]$($createdWorkspaceInfo.GO_PATH)"
12      Write-Host "##vso[task.setvariable variable=GO_WORKSPACE_PATH]$($createdWorkspaceInfo.GO_WORKSPACE_PATH)"
13
14      Write-Host "Prepending Path with $($createdWorkspaceInfo.GO_PATH)/bin"
15
16      # also prepend the path permanently to ensure access the newly installed tools
17      Write-Host "##vso[task.prependpath]$($createdWorkspaceInfo.GO_PATH)/bin"
18    displayName: "Create Go Workspace"
19