parameters:
  - name: archive
    type: string

steps:
  - pwsh: |
      curl -sSL -o goarchive https://dl.google.com/go/${{parameters.archive}}
      tar -xzf goarchive -C "$(Build.SourcesDirectory)/.."

      Write-Host "Prepending Path with $(Build.SourcesDirectory)/../go/bin"

      # also prepend the path permanently to ensure access the newly installed tools
      Write-Host "##vso[task.prependpath]$(Build.SourcesDirectory)/../go/bin"
      go version
    displayName: "Install Go Pre-release Version"
