[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Best approach to update Go packages with the version in the go import path




On 6/11/20 4:07 PM, Shengjing Zhu wrote:
On Thu, Jun 11, 2020 at 4:55 PM Arnaud Rebillout
<arnaud.rebillout@collabora.com> wrote:
More fun now: in the case of gotest.tools, this magic mechanism does not work, and the build fails with multiple lines such as:

     package gotest.tools: code in directory /tmp/gotestdir/src/gotest.tools expects import "gotest.tools/v3"

After much painful investigation, I found out that gotest.tools uses "import aliases" everywhere. That is, lines such as:

     package assert // import "gotest.tools/v3/assert"

The directive "// import ..." is an import alias, and that's what prevents Go from dealing with the import path successfully.

That feels awkward... Can we just add a patch to remove this alias?

Yep I'm doing exactly that at the moment, and discussing the issue with upstream [1]. It seems like these import aliases are not needed anyway.

[1]: https://github.com/gotestyourself/gotest.tools/issues/203



Reply to: