// charsetReader returns a reader that converts from the given charset to UTF-8. // Currently it only supports UTF-8 and ASCII. Otherwise, it returns a meaningful // error which is printed by go get, so the user can find why the package // wasn't downloaded if the encoding is not supported. Note that, in // order to reduce potential errors, ASCII is treated as UTF-8 (i.e. characters // greater than 0x7f are not rejected). func charsetReader(charset string, input io.Reader) (io.Reader, error) { … } // parseMetaGoImports returns meta imports from the HTML in r. // Parsing ends at the end of the <head> section or the beginning of the <body>. func parseMetaGoImports(r io.Reader, mod ModuleMode) ([]metaImport, error) { … } // attrValue returns the attribute value for the case-insensitive key // `name`, or the empty string if nothing is found. func attrValue(attrs []xml.Attr, name string) string { … }