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

E0719 17:34:33.309647 97171 depend.go:81] failed to import #27

Closed
iyashu opened this issue Jul 19, 2017 · 10 comments
Closed

E0719 17:34:33.309647 97171 depend.go:81] failed to import #27

iyashu opened this issue Jul 19, 2017 · 10 comments

Comments

@iyashu
Copy link

iyashu commented Jul 19, 2017

E0719 17:34:33.309647 97171 depend.go:81] failed to import github.com/yashpal1995/mycode:
cannot find package "vendor/github.com/yashpal1995/mycode/" in any of:
$GOROOT
$GOPATH

$GOPATH/bin/goreporter -p github.com/yashpal1995/mycode -r ~/goreporter

why it's searching in vendor directory of $GOPATH?

@wgliang
Copy link
Collaborator

wgliang commented Jul 19, 2017

Because it is necessary to build a project dependent tree.If the default path is not found, check the vendor path.

@JulienTant
Copy link

JulienTant commented Jul 22, 2017

I have the exact same issue. I have a project with a lot of "subpackages", and it looks like it cannot find them

@wgliang
Copy link
Collaborator

wgliang commented Jul 23, 2017

@JulienTant What is the structure of your catalog?

@JulienTant
Copy link

JulienTant commented Jul 23, 2017

it looks like

root
  |- package1
	|- package1-1
	|- package1-2
  |- package2
	|- package2-1
	|- package2-2
	|- package2-3
  |- package3
	|- package3-1
	|- package3-1

where "root" is located in $GOPATH/src/root.

So I cd $GOPATH/src/root and I run goreporter -p . -r /tmp/report -f html, then i got errors like

can't load package "package1/package1-1": cannot find package "package1/package1-1" in any of:
        /usr/local/Cellar/go/1.8.3/libexec/src/package1/package1-1 (from $GOROOT)
        /Users/a/go/src/package1/package1-1 (from $GOPATH)

What is strange is that root is missing into the package name, I mean in code I import root/package1/package1-1, never just package1/package1-1.

I hope my explanations are clear enough ^^

@wgliang
Copy link
Collaborator

wgliang commented Jul 24, 2017

I'm sorry,I got it. But I think you should run it like: goreporter -p ../root -r /tmp/report -f html.
You need to specify the relative path of your project and include the name root of your project.
This restriction is to avoid some ambiguity.
Hope to solve your problem.

@asheet-bhaskar
Copy link

asheet-bhaskar commented Jul 24, 2017

@wgliang
I am running following command from project directory to generate the report
goreporter -p ../go_surge_app -e "vendor " -f html
But the problem is it includes packages in vendor directory and because of this average coverage % goes down. And if i generate report by deleting vendor directory, average coverage becomes % becomes zero and no GodeGraph.

@wgliang
Copy link
Collaborator

wgliang commented Jul 24, 2017

I've added the vendor to the default exception keyword,due to a lot of feedback on the problem.
You can pull latest code and have a try. @asheet-kumar

@asheet-bhaskar
Copy link

Thanks @wgliang. it works now.

@JulienTant
Copy link

Thanks @wgliang

@wgliang
Copy link
Collaborator

wgliang commented Jul 24, 2017

At your call. @asheet-kumar @JulienTant

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

No branches or pull requests

4 participants