{"record":{"id":"85a7c7a6acb7fae2","repo":"jackwener/OpenCLI","slug":"proxy-golang-org-returned-no-published-versions-fo","errorCode":null,"errorMessage":"proxy.golang.org returned no published versions for \"${modulePath}\".","messagePattern":"proxy\\.golang\\.org returned no published versions for \"(.+?)\"\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"warning","filePath":"clis/goproxy/versions.js","lineNumber":37,"sourceCode":"    strategy: Strategy.PUBLIC,\n    browser: false,\n    args: [\n        { name: 'module', positional: true, type: 'string', required: true, help: 'Go module path (e.g. \"github.com/gin-gonic/gin\")' },\n        { name: 'limit', type: 'int', default: 30, help: 'Max rows to return (1-200)' },\n        { name: 'with-time', type: 'boolean', default: false, help: 'Fetch each version\\'s publish time (one extra request per row)' },\n    ],\n    columns: [\n        'rank', 'module', 'version', 'publishedAt', 'url',\n    ],\n    func: async (args) => {\n        const modulePath = requireModulePath(args.module);\n        const limit = requireBoundedInt(args.limit, 30, 200, 'limit');\n        const withTime = args['with-time'] === true;\n        const encoded = modulePath.split('/').map(encodeURIComponent).join('/');\n        const text = await goproxyText(`${GOPROXY_BASE}/${encoded}/@v/list`, `goproxy versions ${modulePath}`);\n        const raw = text.split(/\\r?\\n/).map((line) => line.trim()).filter(Boolean);\n        if (raw.length === 0) {\n            throw new EmptyResultError('goproxy versions', `proxy.golang.org returned no published versions for \"${modulePath}\".`);\n        }\n        const sorted = sortVersionsDescending(raw).slice(0, limit);\n        if (sorted.length === 0) {\n            throw new EmptyResultError('goproxy versions', `\"${modulePath}\" has no semver-shaped tags on proxy.golang.org.`);\n        }\n        const rows = sorted.map((v, i) => ({\n            rank: i + 1,\n            module: modulePath,\n            version: v,\n            publishedAt: null,\n            url: `${GOPROXY_BASE}/${encoded}/@v/${encodeURIComponent(v)}.info`,\n        }));\n        if (withTime) {\n            // Sequential to keep the proxy happy; cap at limit which is already <=200.\n            for (const row of rows) {\n                const info = await goproxyJson(`${GOPROXY_BASE}/${encoded}/@v/${encodeURIComponent(row.version)}.info`, `goproxy versions ${modulePath} ${row.version}`);\n                row.publishedAt = trimDate(info?.Time);\n            }","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/goproxy/versions.js#L19-L55","documentation":"Thrown by the `goproxy versions` command when the @v/list endpoint responds successfully but returns an empty list, meaning proxy.golang.org knows the module but has no published versions indexed for it. The library converts this legitimate empty state into an EmptyResultError so callers can distinguish 'no data' from a hard failure.","triggerScenarios":"Running `goproxy versions <modulePath>` where GET https://proxy.golang.org/<module>/@v/list returns 200 with a blank body: module reserved/published without tagged versions, or proxy cache has no version listing yet.","commonSituations":"Typos creating a plausible-but-wrong module path, a repo that has only a default branch with no git tags, a module just published whose listing hasn't propagated, or querying modules that only exist via pseudo-versions elsewhere.","solutions":["Verify the module path against its go.mod / canonical import path","Check the repository for existing git tags (git tag --list); if none, tag and push a semver tag","Try `go list -m -versions <module>` to cross-check what the ecosystem sees","Retry later if the module was published very recently (proxy caching lag)"],"exampleFix":"// before\nawait goproxyVersions({ module: 'example.com/foo/bar' });\n// after\nif (!repoHasSemverTags('example.com/foo/bar')) throw new Error('tag a v1.x.x release first');\nawait goproxyVersions({ module: 'example.com/foo/bar' });","handlingStrategy":"try-catch","validationCode":"// Verify the module is reachable and tagged before calling\nconst res = await fetch('https://proxy.golang.org/' + encodePath(modulePath) + '/@v/list');\nconst list = (await res.text()).trim();\nif (!list) console.warn(modulePath + ' has no published versions');","typeGuard":"function hasVersions(text) { return typeof text === 'string' && text.split(/\\r?\\n/).map(s => s.trim()).filter(Boolean).length > 0; }","tryCatchPattern":"try {\n  const versions = await goproxyVersions({ module });\n} catch (err) {\n  if (/no published versions/i.test(err.message)) {\n    console.warn(`Module ${module} has no tagged releases yet.`);\n  } else throw err;\n}","preventionTips":["Confirm the exact module path from go.mod before querying","Check the repo has v-prefixed semver git tags","Allow for proxy propagation delay after first publish","Cross-check with `go list -m -versions`"],"tags":["go","empty-result","http","modules"],"backgroundTag":"empty-result-set","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}