Control: title -1 dh-make-golang fails with "../.." in import path

Hi Kentaro,

Thank you for reporting this issue.

On Fri, Aug 20, 2021 at 10:57 PM Kentaro Hayashi <ken...@xdump.org> wrote:
> Package: dh-make-golang
> Version: 0.4.0-1+b6
> Severity: normal
> X-Debbugs-Cc: ken...@xdump.org
>
> # Problem:
>
> When dh-make-golang make is executed for library without no main, no external
> module dependencies, it seems that dh-make-golang will fail.

No, that is not it.  Plenty of existing Go pure library packages (with
no main.go) have been created by dh-make-golang with no issues at all.

The real culprit turns out to be the following code in example/main.go:

    import (
            "../../notificator"
            "log"
    )

Relative import path, especially one that refers to a (grand)parent
directory, and such practice is not supported by Go.
It is the "go list github.com/0xAX/notificator/..." command that fails here.

Indeed, other 0xAX/notificator users have run into issue too:
https://github.com/0xAX/notificator/issues

So, it is not a bug in dh-make-golang but in github.com/0xAX/notificator

That said, I'll add in a workaround that retries running "go list"
without the "/...".
This would allow "go list" to avoid such problematic subdirectory.

> I've found this issue against the following case:
>
> $ dh-make-golang make github.com/0xax/notificator

Please note that Go import paths are case-sensitive.
Please follow how upstream has used uppercase for "AX" in "0xAX", as in:

    $ dh-make-golang make github.com/0xAX/notificator

Kind regards,

Anthony

Reply via email to