FAQ
Hi, from reading http://tip.golang.org/cmd/go/#hdr-Remote_import_paths I
see that go get has the following behavior for vanity import paths:

For example,

import "example.org/pkg/foo"
will result in the following request(s):
https://example.org/pkg/foo?go-get=1 (preferred)
http://example.org/pkg/foo?go-get=1 (fallback)
If that page contains the meta tag
<meta name="go-import" content="example.org git
" rel="nofollow">https://code.org/r/p/exproj">
the go tool will verify that https://example.org/?go-get=1 contains the
same meta tag and then git clone https://code.org/r/p/exproj into
GOPATH/src/example.org.

First question, what is the *purpose* of doing a second query on the
example.org/ root?

Second, what does it mean "contains the *same* meta tag"? Should it
literally be byte for byte the same? How does the webserver know that it
should mention exproj in the meta tag when example.org/ is queried?

I think most of my confusion comes from trying this out on rsc.io/pdf
vanity import path:

~ $ curl http://rsc.io/pdf?go-get=1
<head>
<meta http-equiv="refresh" content="0; URL='http://godoc.org/rsc.io/pdf'">
<meta name="go-import" content="rsc.io/pdf git " rel="nofollow">https://github.com/rsc/pdf">
</head>
~ $ curl http://rsc.io/?go-get=1
<head>
<meta http-equiv="refresh" content="0; URL='http://godoc.org/rsc.io/'">
<meta name="go-import" content="rsc.io/ hg " rel="nofollow">https://code.google.com/p/rsc.">
</head>

The meta tag in the second query does not appear to be anywhere near the
same. Is that intended? If so, what is the logic, and if not, what should
the second query return instead?

Thank you.

P.S. Applying formatting in this post using this UI has been very painful
compared to doing the same using Markdown. :(

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Gary b at Nov 29, 2014 at 12:19 am
    First question, what is the purpose of doing a second query on the
    example.org/ root?

    See the comment at
    https://code.google.com/p/go/source/browse/src/cmd/go/vcs.go#611
    Second, what does it mean "contains the same meta tag"?
    The tags are considered equal if the three fields in the content attribute
    are equal.
    I think most of my confusion comes from trying this out on rsc.io/pdf
    vanity import path

    The second query is for the prefix, not for the root of the domain.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dmitri Shuralyov at Nov 29, 2014 at 1:41 am
    Thank you for answering all my questions so concisely and thoroughly.

    I understand now. So, a correct thing to try would've been:

    ~ $ curl http://rsc.io/pdf/pdfpasswd?go-get=1
    <head>
    <meta http-equiv="refresh" content="0;
    URL='http://godoc.org/rsc.io/pdf/pdfpasswd'">
    <meta name="go-import" content="rsc.io/pdf git " rel="nofollow">https://github.com/rsc/pdf">
    </head>
    ~ $ curl http://rsc.io/pdf?go-get=1
    <head>
    <meta http-equiv="refresh" content="0; URL='http://godoc.org/rsc.io/pdf'">
    <meta name="go-import" content="rsc.io/pdf git " rel="nofollow">https://github.com/rsc/pdf">
    </head>

    Which makes sense.

    On Friday, November 28, 2014 4:19:50 PM UTC-8, gary b wrote:

    First question, what is the purpose of doing a second query on the
    example.org/ root?

    See the comment at
    https://code.google.com/p/go/source/browse/src/cmd/go/vcs.go#611
    Second, what does it mean "contains the same meta tag"?
    The tags are considered equal if the three fields in the content attribute
    are equal.
    I think most of my confusion comes from trying this out on rsc.io/pdf
    vanity import path

    The second query is for the prefix, not for the root of the domain.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 28, '14 at 9:17p
activeNov 29, '14 at 1:41a
posts3
users2
websitegolang.org

2 users in discussion

Dmitri Shuralyov: 2 posts Gary b: 1 post

People

Translate

site design / logo © 2021 Grokbase