Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change import of "tester" from relative path to full path #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anthonyfok
Copy link

@anthonyfok anthonyfok commented Nov 6, 2020

This solves the "unexpected directory layout" error when go test is
called like so: go test github.com/ianbruene/go-difflib/difflib/...

This was discovered when packaging github.com/ianbruene/go-difflib as golang-github-ianbruene-go-difflib for Debian:

   dh_auto_test -O--builddirectory=_build -O--buildsystem=golang
        cd _build && go test -vet=off -v -p 4 github.com/ianbruene/go-difflib/difflib github.com/ianbruene/go-difflib/difflib/bytes github.com/ianbruene/go-difflib/difflib/tester
unexpected directory layout:
        import path: _/<<PKGBUILDDIR>>/_build/src/github.com/ianbruene/go-difflib/difflib/tester
        root: /<<PKGBUILDDIR>>/_build/src
        dir: /<<PKGBUILDDIR>>/_build/src/github.com/ianbruene/go-difflib/difflib/tester
        expand root: /<<PKGBUILDDIR>>/_build
        expand dir: /<<PKGBUILDDIR>>/_build/src/github.com/ianbruene/go-difflib/difflib/tester
        separator: /
unexpected directory layout:
        import path: _/<<PKGBUILDDIR>>/_build/src/github.com/ianbruene/go-difflib/difflib/tester
        root: /<<PKGBUILDDIR>>/_build/src
        dir: /<<PKGBUILDDIR>>/_build/src/github.com/ianbruene/go-difflib/difflib/tester
        expand root: /<<PKGBUILDDIR>>/_build
        expand dir: /<<PKGBUILDDIR>>/_build/src/github.com/ianbruene/go-difflib/difflib/tester
        separator: /
dh_auto_test: error: cd _build && go test -vet=off -v -p 4 github.com/ianbruene/go-difflib/difflib github.com/ianbruene/go-difflib/difflib/bytes github.com/ianbruene/go-difflib/difflib/tester returned exit code 1

I've already applied the patch for the Debian package (see https://salsa.debian.org/go-team/packages/golang-github-ianbruene-go-difflib/-/blob/debian/sid/debian/patches/01-fix-unexpected-directory-layout-error-during-go-test.patch) so it is OK on the Debian side.

Please feel free to merge this PR or not depending on your preference on relative import paths vs. full paths.
(I was reading the debate at golang/go#20883 and realized both sides have good arguments...)

Many thanks!

Cheers,
Anthony

This solves the "unexpected directory layout" error when "go test" is
called like so: "go test github.com/ianbruene/go-difflib/difflib/..."
@rcoreilly
Copy link

This is now a blocking bug on go 1.18 -- go mod tidy chokes on it. any chance you could apply this PR?

@Dorbmon
Copy link

Dorbmon commented May 28, 2022

Yes. Now it stops me from compiling it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants