golang/go · error
fetching %s: no go-import meta tag found in %s
Error message
fetching %s: no go-import meta tag found in %s
What it means
The fetched and parsed page contained zero go-import meta entries — not a parse error (that is 1149), the page tokenized fine but had no matching tags. The %s is the import prefix; the second %s is resp.URL.
Source
Thrown at src/cmd/go/internal/vcs/vcs.go:1168
resp, err := web.Get(security, url)
if err != nil {
return setCache(fetchResult{url: url, err: fmt.Errorf("fetching %s: %v", importPrefix, err)})
}
body := resp.Body
defer body.Close()
imports, err := parseMetaGoImports(body, mod)
if len(imports) == 0 {
if respErr := resp.Err(); respErr != nil {
// If the server's status was not OK, prefer to report that instead of
// an XML parse error.
return setCache(fetchResult{url: url, err: respErr})
}
}
if err != nil {
return setCache(fetchResult{url: url, err: fmt.Errorf("parsing %s: %v", resp.URL, err)})
}
if len(imports) == 0 {
err = fmt.Errorf("fetching %s: no go-import meta tag found in %s", importPrefix, resp.URL)
}
return setCache(fetchResult{url: url, imports: imports, err: err})
})
res := resi.(fetchResult)
return res.url, res.imports, res.err
}
type fetchResult struct {
url *urlpkg.URL
imports []metaImport
err error
}
// metaImport represents the parsed <meta name="go-import"
// content="prefix vcs reporoot subdir" /> tags from HTML files.
type metaImport struct {
Prefix, VCS, RepoRoot, SubDir string
}View on GitHub (pinned to b6b368adc5)
Solutions
- Add <meta name='go-import' content='<prefix> <vcs> <repo>'> to the host's HTML
- Verify you're hitting the right host (inspect redirects)
- Switch to a module proxy if you can't control the host's HTML
Defensive patterns
Strategy: validation
Prevention
- Add the go-import meta tag to every host that serves a Go vanity path
- If you can't edit the host, publish the module via a Go proxy (GOPROXY) instead
When it happens
Trigger: The prefix host returns a valid HTML page with no <meta name='go-import'> tags at all, and resp.Err() was nil.
Common situations: Asking for a path whose host doesn't serve Go vanity headers; pointing at a plain website; forgot to add go-import meta tags; redirected to a marketing page.
Related errors
- parse %s: %v
- parse %s: no go-import meta tags (%s)
- %s and %s disagree about go-import for %s
- %s: invalid subdirectory %q: %v
- %s: invalid repo root %q: %v
AI-assisted analysis of golang/go@b6b368adc5 (2026-08-12).
Data as JSON: /api/errors/e4d4d009cb248e80.
Report an issue: GitHub.