docker - 如何修复 GitHub Actions 中的 golangci-lint 错误?
问题描述
我收到了这个错误:
Run actions-contrib/golangci-lint@v1
/usr/bin/docker run --name cc495678c14da19ea04d82b4276bf15086b4bc_b162c0 --label cc4956 --workdir /github/workspace --rm -e GOROOT -e INPUT_GOLANGCI_LINT_VERSION -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/foo/foo":"/github/workspace" cc4956:78c14da19ea04d82b4276bf15086b4bc
level=warning msg="Failed to discover go env: failed to run 'go env': exit status 2"
level=error msg="Running error: context loading failed: failed to load program with go/packages: could not parse GOARCH and Go compiler in format \"<GOARCH> <compiler>\" from stdout of go command:\nGOROOT=/opt/hostedtoolcache/go/1.15.6/x64 GOPATH=/go GO111MODULE= *** go [list -f {{context.GOARCH}} {{context.Compiler}} -- unsafe]\ndir: /github/workspace\nstdout: <<>>\nstderr: <<go: cannot find GOROOT directory: /opt/hostedtoolcache/go/1.15.6/x64\n>>"
添加时
- name: Run golangci-lint
- uses: actions/checkout@v2
- name: Run golangci-lint
uses: actions-contrib/golangci-lint@v1
到go.yml
.
解决方案
推荐阅读
- java - 如何使用 Appium 在 Android Studio for java 中为除 First Activity 之外的 Activity 编写自动化测试
- javascript - 流默认值类型检查
- r - R - Aggregating and returning value that minimises another dimension
- sql - 加入并计算出现次数
- c# - 如果命令行开关遇到错误,如何终止脚本执行
- java - 设置阿尔巴尼亚语/黑山语语言环境时,它会恢复为默认值
- django - Beanstalk 没有运行 makemigrations
- android - 蓝牙广告的制造商特定数据中的字节不断变化
- android-ndk - 将 java 位图对象发送到本机类以进行图像处理
- python - 如何在熊猫数据框列中用空白替换字符串?