$ go version
go version devel +bdf690b6a741 Fri Mar 08 10:41:20 2013 -0800 linux/386
$ go tool | grep '^.g$'
8g
$ uname -a
Linux dragon 3.5.7-gentoo-devtmpfs #2 SMP Fri Feb 1 13:03:07 EST 2013 i686 Pentium III (Katmai) GenuineIntel GNU/Linux
$
I expect the following command to go get a package. What it does instead is
shown below.
$ go get -v sethwklein.net/go/gogettest
Fetching https://sethwklein.net/go/gogettest?go-get=1
https fetch failed.
Fetching http://sethwklein.net/go/gogettest?go-get=1
Parsing meta tags from http://sethwklein.net/go/gogettest?go-get=1 (status code 200)
import "sethwklein.net/go/gogettest": parse http://sethwklein.net/go/gogettest?go-get=1: no go-import meta tags
package sethwklein.net/go/gogettest: unrecognized import path "sethwklein.net/go/gogettest"
$
Note it saying, "no go-import meta tags". Let's check...
$ curl -i 'http://sethwklein.net/go/gogettest?go-get=1'
HTTP/1.1 200 OK
Date: Fri, 08 Mar 2013 18:51:03 GMT
Server: Apache
Last-Modified: Fri, 08 Mar 2013 18:48:39 GMT
ETag: "cdfd0-b3-4d76e457c6fc0"
Accept-Ranges: bytes
Content-Length: 179
Content-Type: text/html
$
Looks like a go-import meta tag to me.
Now if that was served as xhtml, I could think of four or five problems with it
just off the top of my head. But it's not. It's served as text/html with no
file extension.
This version works:
$ go get -v sethwklein.net/go/gogettestworks
Fetching https://sethwklein.net/go/gogettestworks?go-get=1
https fetch failed.
Fetching http://sethwklein.net/go/gogettestworks?go-get=1
Parsing meta tags from http://sethwklein.net/go/gogettestworks?go-get=1 (status code 200)
get "sethwklein.net/go/gogettestworks": found meta tag main.metaImport{Prefix:"sethwklein.net/go/gogettestworks", VCS:"git", RepoRoot:"http://github.com/sethwklein/gogettest"} at http://sethwklein.net/go/gogettestworks?go-get=1
sethwklein.net/go/gogettestworks (download)
sethwklein.net/go/gogettestworks
$ curl -i 'http://sethwklein.net/go/gogettestworks?go-get=1'
HTTP/1.1 200 OK
Date: Fri, 08 Mar 2013 18:53:00 GMT
Server: Apache
Last-Modified: Fri, 08 Mar 2013 18:48:42 GMT
ETag: "cdfcd-ba-4d76e45aa3680"
Accept-Ranges: bytes
Content-Length: 186
Content-Type: text/html
$
The difference is href=foo.css -> href="foo.css".
Both versions are valid according to
http://www.w3.org/TR/html-markup/syntax.html#attr-value-unquoted
and gorgeous compared to much of the html in the wild.
I would blame this on using an xml parser to parse html[1], but the presence
meta charset tag, also with an unquoted attribute value, in both versions
suggests it's not so simple.
Thanks to kisielk on #go-nuts for figuring out the problem[2].
[1]: http://golang.org/src/cmd/go/discovery.go?h=parseMetaGoImports#L22
[2]: https://botbot.me/freenode/go-nuts/msg/2224418/