whyrusleeping / gx-go

gx subtool for golang
MIT License
80 stars 28 forks source link

Remove the necessity for rewrite #27

Open paralin opened 6 years ago

paralin commented 6 years ago

The rewriting in GX seems like a hack to me. I'd prefer for readability to not have hashes in my imports when developing.

Why don't you just check the code out to it's original path inside a vendor tree?

$GOPATH/src/github.com/paralin/myproject/vendor/github.com/libp2p/go-libp2p-crypto

etc...

whyrusleeping commented 6 years ago

@paralin this works unless you have different versions of the same package. I've been meaning to add a command that does this for a while actually, could easily be an install option. If you're feeling up to it, PRs are definitely welcome ;)

paralin commented 6 years ago

@whyrusleeping That's an interesting thought about the multiple versions... Except I think most Go packages are designed to only be imported once, at a single version, unlike Node packages. Most projects wouldn't suffer from the loss of functionality.

My main concern is the corruption of the changelog in Git by having every single file touched whenever we update a vendored dependency. I know you have rewrite and unrewrite for this, but it makes sense to me to instead just not bother keeping the versions in the path after all.

I can make a PoC and/or a PR, will add it to my to-dos.

whyrusleeping commented 6 years ago

@paralin Yeah, I agree on the multiple versions thing. I don't think anyone would miss it (though in go-ipfs, we would currently run into an issue here because we have two versions of golang.org/x/sys for some reason)

I can make a PoC and/or a PR, will add it to my to-dos.

great! If you have any questions let me know. :)