-
Notifications
You must be signed in to change notification settings - Fork 70
Fix #123 #130
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
Fix #123 #130
Conversation
Codecov Report
@@ Coverage Diff @@
## gopath-fix #130 +/- ##
=============================================
Coverage ? 80.22%
=============================================
Files ? 15
Lines ? 2797
Branches ? 0
=============================================
Hits ? 2244
Misses ? 378
Partials ? 175
Continue to review full report at Codecov.
|
Thanks for the contribution! We're at a conference right now, but will try to take a look at it as soon as possible.
On Fri, 21 Apr 2017 at 08:31, codecov[bot] <[email protected]<mailto:[email protected]>> wrote:
Codecov<https://codecov.io/gh/src-d/go-kallax/pull/130?src=pr&el=h1> Report
Merging #130<https://codecov.io/gh/src-d/go-kallax/pull/130?src=pr&el=desc> into master<https://codecov.io/gh/src-d/go-kallax/commit/dce9f7c285e7f341474e16f53098917104013474?src=pr&el=desc> will decrease coverage by 0.13%.
The diff coverage is 69.23%.
[Impacted file tree graph]<https://codecov.io/gh/src-d/go-kallax/pull/130?src=pr&el=tree>
@@ Coverage Diff @@
## master #130 +/- ##
==========================================
- Coverage 80.35% 80.22% -0.14%
==========================================
Files 15 15
Lines 2785 2797 +12
==========================================
+ Hits 2238 2244 +6
- Misses 375 378 +3
- Partials 172 175 +3
Impacted Files<https://codecov.io/gh/src-d/go-kallax/pull/130?src=pr&el=tree> Coverage Δ
generator/template.go<https://codecov.io/gh/src-d/go-kallax/pull/130?src=pr&el=tree#diff-Z2VuZXJhdG9yL3RlbXBsYXRlLmdv> 92.37% <100%> (-0.53%) ⬇️
generator/processor.go<https://codecov.io/gh/src-d/go-kallax/pull/130?src=pr&el=tree#diff-Z2VuZXJhdG9yL3Byb2Nlc3Nvci5nbw==> 87.96% <63.63%> (-1.1%) ⬇️
…________________________________
Continue to review full report at Codecov<https://codecov.io/gh/src-d/go-kallax/pull/130?src=pr&el=continue>.
Legend - Click here to learn more<https://docs.codecov.io/docs/codecov-delta>
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov<https://codecov.io/gh/src-d/go-kallax/pull/130?src=pr&el=footer>. Last update dce9f7c...5452456<https://codecov.io/gh/src-d/go-kallax/pull/130?src=pr&el=lastupdated>. Read the comment docs<https://docs.codecov.io/docs/pull-request-comments>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#130 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ABQFF415nBina5aL0ocZkJKRUBHbXF1Xks5ryEyygaJpZM4ND6SA>.
|
|
||
func removeGoPath(path string) string { | ||
return strings.Replace(path, goPath+"/src/", "", -1) | ||
for _, goPath := range goPaths { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be better to use a strings.Replacer (though strings.NewReplacer is not very practical to use in this case)
var goPaths = filepath.SplitList(build.Default.GOPATH) | ||
|
||
func getPkgSrcDir(importPath string) (string, error) { | ||
wd, err := os.Getwd() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not really sure that the current working directory is the good thing to pass to build.Import, but it seems to do the job
I merged the test change from the But I can't reproduce that fail on my local... |
This approach only works while using EDIT: i think we should fix this in go-parse-utils (though there's still things to fix here even if we do it there). |
Closing this in favor of #138. Thanks for the contribution! |
ah, I forgot I had src-d/go-parse-utils#6 on my local, might have been what made my tests pass. Anyway, #138 looks good 👍 |
To test it,
export GOPATH=~/go:/tmp/whatever
andgo test -v ./generator/
. On master it fails :After this PR it passes