Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: get fails for <meta name="go-import" ...> when document has encoding other than utf-8 #5801

Closed
kisielk opened this issue Jun 27, 2013 · 3 comments
Milestone

Comments

@kisielk
Copy link
Contributor

kisielk commented Jun 27, 2013

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. go get -v kamilkisiel.net/go/bugascii

What is the expected output?
$ go get -v kamilkisiel.net/go/bugutf8
Fetching https://kamilkisiel.net/go/bugutf8?go-get=1
https fetch failed.
Fetching http://kamilkisiel.net/go/bugutf8?go-get=1
Parsing meta tags from http://kamilkisiel.net/go/bugutf8?go-get=1 (status code 200)
get "kamilkisiel.net/go/bugutf8": found meta tag
main.metaImport{Prefix:"kamilkisiel.net/go/bugutf8", VCS:"git",
RepoRoot:"https://github.com/kisielk/gotool";} at
http://kamilkisiel.net/go/bugutf8?go-get=1
kamilkisiel.net/go/bugutf8 (download)
kamilkisiel.net/go/bugutf8

What do you see instead?
$ go get -v kamilkisiel.net/go/bugascii
Fetching https://kamilkisiel.net/go/bugascii?go-get=1
https fetch failed.
Fetching http://kamilkisiel.net/go/bugascii?go-get=1
Parsing meta tags from http://kamilkisiel.net/go/bugascii?go-get=1 (status code 200)
import "kamilkisiel.net/go/bugascii": parse
http://kamilkisiel.net/go/bugascii?go-get=1: no go-import meta tags
package kamilkisiel.net/go/bugascii: unrecognized import path
"kamilkisiel.net/go/bugascii"

Which version are you using?  (run 'go version')
go 1.1

Please provide any additional information below.

The only difference between the two paths is the encoding at the top of the file.
bugascii has:

<?xml version="1.0" encoding="ascii"?>

bugutf8 has:

<?xml version="1.0" encoding="utf-8"?>

After instrumenting the go tool's discovery.go and found the error is coming from the
XML decoder:

"error: xml: encoding "ascii" declared but Decoder.CharsetReader is
nil"

Unfortunately this kind of error is not reported anywhere by the Go tool and I spent
quite a while chasing it down. Either the tool should handle encodings other than utf-8
or else report the error in a way that doesn't imply the user did something wrong with
placing the meta tag on their page.
@bradfitz
Copy link
Contributor

Comment 1:

Nice.

Owner changed to @bradfitz.

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 2:

Labels changed: added priority-later, go1.2, removed priority-triage.

@bradfitz
Copy link
Contributor

bradfitz commented Aug 2, 2013

Comment 3:

This issue was closed by revision bbf1430.

Status changed to Fixed.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants