Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

main: fix gopkg.in path handling #72

Merged
merged 1 commit into from
Mar 27, 2019
Merged

main: fix gopkg.in path handling #72

merged 1 commit into from
Mar 27, 2019

Conversation

myitcv
Copy link
Owner

@myitcv myitcv commented Mar 23, 2019

Also fix a bug whereby the full import path was being used after the
module path for locations within the cache.

Fixes #65.

Also fix a bug whereby the full import path was being used after the
module path for locations within the cache. For example, previously we
had a cache path like:

/github.com/gobin-testrepos/simple-main/@v/v1.0.0/github.com/gobin-testrepos/simple-main/simple-main

whereas this should actually have been:

github.com/gobin-testrepos/simple-main/@v/v1.0.0/simple-main

Fixes #65.
@myitcv myitcv force-pushed the fix_gopkg_handling branch 2 times, most recently from d36e45f to 96e86c0 Compare March 23, 2019 08:49
@myitcv myitcv requested a review from mvdan March 23, 2019 08:49
// we've already uniquely identified the module. If there are
// case flips within a module then... well, we'll see.
pkgRem := strings.TrimPrefix(mp.ImportPath, mp.Module.Path+"/")
mainrel = filepath.Join(md, filepath.FromSlash(pkgRem))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be path, not filepath? since it's a module import path, and not a path of a directory on disk.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filepath is correct here I think. md is the file path of the encoded module path. Hence it only makes sense to join another filepath.

@myitcv myitcv merged commit 7976ade into master Mar 27, 2019
@myitcv myitcv deleted the fix_gopkg_handling branch March 27, 2019 14:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot install gopkg.in/httprequest.v1/cmd/httprequest-generate-client
2 participants