#590·usql

使用 0.21.5 进行安装失败

作者: jonmz创建于 2026年9月14日更新于 2026年9月14日

在安装 0.21.4 时一切顺利:

bash
[builduser@stardust ~]$ go install GitHub.com/xo/[email protected]
go: downloading GitHub.com/xo/usql v0.21.4
go: downloading GitHub.com/go-git/go-billy/v5 v5.8.0
go: downloading GitHub.com/mattn/go-isatty v0.0.20
go: downloading GitHub.com/spf13/cobra v1.10.2
go: downloading GitHub.com/spf13/pflag v1.0.10
[...]

但是安装 0.21.5 失败:

bash
[builduser@stardust ~]$ go install GitHub.com/xo/[email protected]
go: GitHub.com/xo/[email protected] (in GitHub.com/xo/[email protected]):
        The go.mod file for the module providing named packages contains one or
        more exclude directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.

这也影响了 usql@latest,虽然它 官方文档中 说明了如何安装,但也失败了:

bash
[builduser@stardust ~]$ go install GitHub.com/xo/usql@latest
go: GitHub.com/xo/usql@latest (in GitHub.com/xo/[email protected]):
        The go.mod file for the module providing named packages contains one or
        more exclude directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.

看起来,与 https://GitHub.com/xo/usql/issues/394 相同的问题,该问题来自 2023 年,并且已经解决。这次看来,go.mod 中的 dd10b0bfcace3b22bf875f819ce44062d3d3f7a5#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R378 就是问题所在。