bla 在 go.mod 中明确要求,但在vendor/modules.txt 中未标记为显式

问题描述 投票:0回答:1

我有 monorepo,在本地运行得很好,但是当它在 CI 上运行时,它会显示类似这样的奇怪错误:

go: inconsistent vendoring in /__w/x/apps/foo-agent:
    github.com/go-faker/faker/[email protected]: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt

我检查了多次,

go.mod
或源代码树中的任何地方都没有faker导入

go mod why github.com/go-faker/faker/v4
# github.com/go-faker/faker/v4
(main module does not need package github.com/go-faker/faker/v4)

还尝试了

go get ./...
go mod tidy
go mod vendor
,但源代码树中没有任何变化。

正在运行的命令是:

CGO_ENABLED=1 go test -v -race -coverprofile=./coverage.out `go list ./... | grep "foo-agent" | grep -v /test | tr "\n" " "`
go
1个回答
0
投票

显然这是特定于 CI 工作流程的,我忘记在 github CI 上添加,这就是为什么它继续运行分支的旧代码

      - name: Checkout
        uses: actions/checkout@v3

关于我的工作流程的这一部分:

  unit-tests:
    if: ${{ true }}
    runs-on: "self-hosted"
    needs: build
    steps:
© www.soinside.com 2019 - 2024. All rights reserved.