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

[Question] How to vendor main from 3rd party? #71

Open
kron4eg opened this issue Dec 20, 2016 · 2 comments
Open

[Question] How to vendor main from 3rd party? #71

kron4eg opened this issue Dec 20, 2016 · 2 comments

Comments

@kron4eg
Copy link

kron4eg commented Dec 20, 2016

I have dependency on other Go project's executable, in my case protoc-gen-go, I've vendored the library but as trash works it's just remove "main" go file since it's not imported anywhere in my project.

Currently I've created ./cmd/protoc-gen-go/main.go which is just a copy of github.com/golang/protobuf/protoc-gen-go/main.go but this seems very odd. Is there any other and better options?

@silasdavis
Copy link

silasdavis commented May 22, 2017

Here's an approach I use, it's not ideal, but it's the cleanest hack I could come up with:

https://github.com/monax/cli/blob/master/install_vendor.sh

The idea is to restore specific paths that you want to keep by copying them in from Trash's cache of that repo (which will be at the appropriate version immediately after Trash has used it, obviously not concurrently safe, though you can use a custom trash cache location).

@kron4eg
Copy link
Author

kron4eg commented May 22, 2017

I've started to use golang/dep

required = [
    "github.com/golang/protobuf/protoc-gen-go",
    "gopkg.in/alanctgardner/gogen-avro.v4",
]

solved the problem :)

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

No branches or pull requests

2 participants