1 回答

TA貢獻(xiàn)1829條經(jīng)驗(yàn) 獲得超7個(gè)贊
因此,如果您查看完整的錯(cuò)誤消息:
##[error]keywords.go:8:2: cannot find package "github.com/securisec/go-keywords/languages" in any of:
/opt/hostedtoolcache/go/1.10.0/x64/src/github.com/securisec/go-keywords/languages (from $GOROOT)
/home/runner/work/go-keywords/src/github.com/securisec/go-keywords/languages (from $GOPATH)
##[error]Process completed with exit code 1.
您會(huì)注意到您正在嘗試在 Go 1.10 中運(yùn)行代碼。Go 模塊是在 Go 1.11 中引入的,所以它總是會(huì)抱怨應(yīng)用程序沒(méi)有安裝依賴項(xiàng)。
然后,如果您查看 Go 設(shè)置日志:
Go setup
GO111MODULE: on
##[warning]Unexpected input 'go-version', valid inputs are ['version']
Run actions/setup-go@v1.0.0
with:
go-version: 1.11
version: 1.10
env:
GOPATH: /home/runner/work/go-keywords
GO111MODULE: on
/bin/tar xzC /home/runner/work/_temp/0ce9b622-d798-400e-b86a-42d36359ad78 -f /home/runner/work/_temp/80f228cc-4b21-427f-b111-d9f296ed4990
您會(huì)看到安裝程序發(fā)出警告并默認(rèn)為您安裝 go 1.10。
那是因?yàn)槟厌槍?duì)不了解 go-version 標(biāo)志的特定版本 v1.0.0。(我認(rèn)為它是在 v1.1.0 中添加的)
解決方案:
更改uses: actions/setup-go@v1.0.0以u(píng)ses: actions/setup-go@v1獲取最新的 v1 版本。
甚至更好地使用 v2。
- 1 回答
- 0 關(guān)注
- 278 瀏覽
添加回答
舉報(bào)