go - 如何在 Azure 管道中使用 Go Beta/RC 版本
问题描述
我想在 Azure 管道中使用 Go 的 beta 或发布候选版本,但任务“Go 工具安装程序”不适用于“1.17rc1”之类的版本。
管道
$(go_version) = 1.17rc1
steps:
- task: GoTool@0
displayName: Install Go tools in version $(go_version)
inputs:
version: $(go_version)
输出
2021-07-15T08:01:13.5566938Z ##[section]Starting: Install Go tools in version 1.17rc1
2021-07-15T08:01:13.5573377Z ==============================================================================
2021-07-15T08:01:13.5573650Z Task : Go tool installer
2021-07-15T08:01:13.5574064Z Description : Find in cache or download a specific version of Go and add it to the PATH
2021-07-15T08:01:13.5574305Z Version : 0.180.0
2021-07-15T08:01:13.5574495Z Author : Microsoft Corporation
2021-07-15T08:01:13.5574776Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/tool/go-tool
2021-07-15T08:01:13.5575073Z ==============================================================================
2021-07-15T08:01:13.8414712Z Downloading: https://storage.googleapis.com/golang/go1.17rc1.linux-amd64.tar.gz
2021-07-15T08:01:16.3008064Z Extracting archive
2021-07-15T08:01:16.3027619Z [command]/usr/bin/tar xC /home/vsts/work/_temp/50a79994-bdb5-417d-8374-cd9746166c5f -f /home/vsts/work/_temp/d2be4a68-029c-4393-8492-5b804e41857e
2021-07-15T08:01:19.0933870Z Caching tool: go null x64
2021-07-15T08:01:19.1004014Z ##[error]TypeError: Cannot read property 'trim' of null
2021-07-15T08:01:19.1090132Z ##[section]Finishing: Install Go tools in version 1.17rc1
解决方案
这看起来像是任务本身的问题。它在这里抛出:
async function run() {
try {
let version = tl.getInput('version', true).trim();
await getGo(version);
telemetry.emitTelemetry('TaskHub', 'GoToolV0', { version });
}
catch (error) {
tl.setResult(tl.TaskResult.Failed, error);
}
}
这有点奇怪,因为我在这里看不到任何阻止放在那里的逻辑1.17rc1
。我在GitHub 上为此创建并发布
推荐阅读
- kubernetes - 无法通过 kubelet 指标获取 PVC 的使用情况
- modelica - openmodelica中流体库的奇怪问题
- python - 基于第一行合并多维 NumPy 数组
- excel - xlPercentOfTotal 正在计算总计的百分比(整个数据集而不是数据透视表中的总和)
- javascript - 执行关联的回调后如何停止 weblistener?
- php - 如何查找自定义字段名称以编写 wp all import php 函数
- javascript - Javascript中具有置信度的T分布
- python - 如何使用日期时间索引从熊猫数据框中的某个日期选择行
- json - 如何处理 JSON_VALUE 路径中的美元 ($) 符号
- ios - 如何符号化包含我的框架的 iOS 应用程序的日志?