On Wed, Nov 27, 2013 at 10:40 AM, TR NS <
tran...@gmail.com> wrote:
>
>
> On Tuesday, November 26, 2013 10:24:52 PM UTC-5, Andrew Gerrand wrote:
>>
>>
>> On 27 November 2013 13:42, TR NS <
tran...@gmail.com> wrote:
>>>
>>> I read that, but I thought I must be missing something. Apparently not.
>>> It's a really strange approach. Actually I don't think it's really workable
>>> at all.
>>
>>
>> I don't think anyone uses that feature.
>> It was a help when we released Go 1 and updated the world, but now it's
>> not so useful.
>
>
> Ah ok. Thanks Andrew.
>
> So can I ask (maybe *beg* is a better word)... I was looking over the `go
> get` code and it seems like everything that is needed is already in place
> --it wouldn't take much adjustment to the code, to support an optional
> tag/branch ref on the `import` statement, e.g.
>
> import(
>
github.com/alice/foo v1.1
> )
>
> That's the only significant missing feature that has me looking to 3rd party
> dependency tools rather than using `go get`.
I have actually hacked support for that by subverting the existing
support for the semi-magic go1-tag:
https://github.com/msiebuhr/go-tag-test
(I haven't checked if the patch still applies to go1.2, but if not, it
should be simple to fix.)
It currently only supports URLs from Github on the form
github.com/msiebuhr/go-ta...@v0.0.1/
(Where the tag/branch is optional; it is serialised with the
tag/branch on-disk.)
> And the reason for it is quite simple. When another developer/user downloads
> my code and builds, I need to be sure they are getting an identical build to
> mine.
Yup. At least this approach seem to work quite fine for Node.js and
Python (the two I've been working a lot with). I understand that
Bower, Maven and Perl also do it roughly that way.
I have played with vendoring (importing the upstream package into your
tree) but the lack of file-relative imports[0] makes it difficult to
write packages that support this nicely. There are tools to do this
for you, but there doesn't seem to be any community consensus about
which of those is the right one (and most of them are mutually
incompatible).
[0] File-relative imports *does* work in *some* cases. I haven't yet
had the time to dig into it.
--
Morten Siebuhr