{"record":{"id":"912bcedb6fbbf822","repo":"jackwener/OpenCLI","slug":"goproxy-module","errorCode":"goproxy module","errorMessage":"proxy.golang.org returned no @latest entry for \"${modulePath}\".","messagePattern":"proxy\\.golang\\.org returned no @latest entry for \"(.+?)\"\\.","errorType":"exception","errorClass":"EmptyResultError","httpStatus":null,"severity":"error","filePath":"clis/goproxy/module.js","lineNumber":32,"sourceCode":"    domain: 'proxy.golang.org',\n    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\", \"golang.org/x/net\")' },\n    ],\n    columns: [\n        'module', 'version', 'publishedAt', 'vcs', 'repository',\n        'commit', 'ref', 'pkgGoDevUrl', 'url',\n    ],\n    func: async (args) => {\n        const modulePath = requireModulePath(args.module);\n        // GOPROXY spec requires lowercase percent-encoding for capital letters in the\n        // module path (e.g. github.com/Foo/Bar -> github.com/!foo/!bar). Module paths\n        // we accept here are lowercase-only by convention; we still encode each segment.\n        const encoded = modulePath.split('/').map(encodeURIComponent).join('/');\n        const detail = await goproxyJson(`${GOPROXY_BASE}/${encoded}/@latest`, `goproxy module ${modulePath}`);\n        if (!detail || !detail.Version) {\n            throw new EmptyResultError('goproxy module', `proxy.golang.org returned no @latest entry for \"${modulePath}\".`);\n        }\n        const origin = detail.Origin && typeof detail.Origin === 'object' ? detail.Origin : {};\n        return [{\n            module: modulePath,\n            version: String(detail.Version),\n            publishedAt: trimDate(detail.Time),\n            vcs: String(origin.VCS ?? '').trim(),\n            repository: String(origin.URL ?? '').trim(),\n            commit: String(origin.Hash ?? '').trim(),\n            ref: String(origin.Ref ?? '').trim(),\n            pkgGoDevUrl: `https://pkg.go.dev/${modulePath}`,\n            url: `${GOPROXY_BASE}/${encoded}/@latest`,\n        }];\n    },\n});\n","sourceCodeStart":14,"sourceCodeEnd":48,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/goproxy/module.js#L14-L48","documentation":"The goproxy module command queries proxy.golang.org's @latest endpoint for a Go module and throws this EmptyResultError when the response JSON is absent or has no Version field. It means the module proxy has no latest-version record for the module path — usually because the module doesn't exist there or was never resolved.","triggerScenarios":"goproxyJson(GOPROXY_BASE/<encoded>/@latest, ...) returns null/undefined (e.g. HTTP 404/410 from the proxy) or an object without a truthy Version property — for misspelled module paths, private modules not published to the public proxy, or deleted/retracted modules.","commonSituations":"Typo in the module path (e.g. wrong repo name); module exists only in a private repo/VCS and was never fetched by proxy.golang.org; module author removed the repo; capital letters not expected (the code assumes lowercase module paths per GOPROXY encoding); proxy service outage returning empty bodies.","solutions":["Verify the module path is correct and matches its go.mod declaration exactly (all lowercase)","Ensure the module is public / has been fetched via the public proxy at least once (private modules need GOPRIVATE/GONOSUMDB and a different proxy)","Query the proxy manually (curl https://proxy.golang.org/<module>/@latest) to confirm the 404","If the module was renamed, use the new path; if deleted, pin an old version from a cache or fork","Retry on transient proxy errors if the service is temporarily failing"],"exampleFix":"// before\nconst detail = await goproxyJson(`${GOPROXY_BASE}/${encoded}/@latest`, `goproxy module ${modulePath}`);\nif (!detail || !detail.Version) throw new EmptyResultError('goproxy module', `...`);\n// after\nconst path = modulePath.trim().toLowerCase();\nconst detail = await goproxyJson(`${GOPROXY_BASE}/${encodePath(path)}/@latest`, `goproxy module ${path}`);\nif (!detail || !detail.Version) throw new EmptyResultError('goproxy module', `No @latest for \"${path}\" — check the module path is public and correct.`);","handlingStrategy":"validation","validationCode":"// validate module path before invoking\nconst mod = 'github.com/some/module';\nif (!/^[a-z0-9][a-z0-9-.]*(:\\/[a-z0-9-.]+)*$/.test(mod)) throw new Error('invalid module path: ' + mod);\n// or verify it resolves first:\nconst res = await fetch(`https://proxy.golang.org/${mod}/@v/list`);\nif (!res.ok) throw new Error('module not on proxy: ' + mod);","typeGuard":"function hasLatestEntry(detail) {\n  return detail != null && typeof detail === 'object' && typeof detail.Version === 'string' && detail.Version.length > 0;\n}","tryCatchPattern":"try {\n  return await goproxyModuleCommand.func({module: mod});\n} catch (e) {\n  if (String(e.message).includes('no @latest entry')) {\n    throw new Error(`Module \"${mod}\" not found on proxy.golang.org — check spelling and that it is public`);\n  }\n  throw e;\n}","preventionTips":["Double-check module paths for typos before querying","Remember module paths are lowercase; encode segments per GOPROXY spec","Private modules need GOPRIVATE/GOPROXY config — the public proxy will 404 them","Deleted/renamed modules return no @latest; verify the repo still exists"],"tags":["golang","empty-result","module-proxy","not-found"],"backgroundTag":"module-not-found-on-proxy","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}