vndr icon indicating copy to clipboard operation
vndr copied to clipboard

Vendoring standard packages

Open kolyshkin opened this issue 6 years ago • 0 comments

Sometimes a standard package from a particular Go release introduces a regression which can be fixed by using a modified copy of it. So, it would be nice to have an ability to vendor forks of standard packages. Something like this (an entry in vendor.conf:

archive/tar go-1.10 https://github.com:kolyshkin/go-tar.git

Currently, vndr complains:

2018/06/08 18:09:04 unrecognized import path "archive/tar" (import path does not begin with hostname)

so I had to vendor this manually, i.e.

mkdir -p vendor/archive
git clone -b go-1.10 --depth=1 [email protected]:kolyshkin/go-tar.git ./vendor/archive/tar

Now the code that does import "archive/tar" works with my own version of archive/tar, without a need to change the import statements in a bazillion places.

It would be awesome to achieve the same thing by using vndr and avoiding manual steps.

Gory details

You probably don't want to know. In case you do:

  • https://github.com/kolyshkin/go-tar
  • https://github.com/golang/go/issues/24787

kolyshkin avatar Jun 09 '18 01:06 kolyshkin