{"record":{"id":"9eeea73843241800","repo":"gohugoio/hugo","slug":"you-need-to-install-go-to-use-it-see-https-gol","errorCode":null,"errorMessage":" you need to install Go to use it. See https://golang.org/dl/ : %q","messagePattern":" you need to install Go to use it\\. See https://golang\\.org/dl/ : %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"modules/collect.go","lineNumber":897,"sourceCode":"\t}\n\n\treturn out, nil\n}\n\nfunc (c *collector) wrapModuleNotFound(err error) error {\n\tif c.Client.ccfg.IgnoreModuleDoesNotExist {\n\t\treturn nil\n\t}\n\terr = fmt.Errorf(err.Error()+\": %w\", ErrNotExist)\n\tif c.GoModulesFilename == \"\" {\n\t\treturn err\n\t}\n\n\tbaseMsg := \"we found a go.mod file in your project, but\"\n\n\tswitch c.goBinaryStatus {\n\tcase goBinaryStatusNotFound:\n\t\treturn fmt.Errorf(baseMsg+\" you need to install Go to use it. See https://golang.org/dl/ : %q\", err)\n\tcase goBinaryStatusTooOld:\n\t\treturn fmt.Errorf(baseMsg+\" you need to a newer version of Go to use it. See https://golang.org/dl/ : %w\", err)\n\t}\n\n\treturn err\n}\n\ntype vendoredModule struct {\n\tOwner   Module\n\tDir     string\n\tVersion string\n}\n\nfunc createProjectModule(gomod *goModule, workingDir string, conf Config) *moduleAdapter {\n\t// Create a pseudo module for the main project.\n\tvar path string\n\tif gomod == nil {\n\t\tpath = \"project\"","sourceCodeStart":879,"sourceCodeEnd":915,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/modules/collect.go#L879-L915","documentation":"Returned by wrapModuleNotFound (modules/collect.go:897) when c.goBinaryStatus == goBinaryStatusNotFound. This status is set in client.go:793 when executing the 'go' command yields exec.ErrNotFound. Because a go.mod is present but the Go toolchain is absent, Hugo cannot resolve module dependencies and tells the user to install Go.","triggerScenarios":"A go.mod exists in the project (or a theme/module requires the Go module integration), Hugo invokes the go binary to download modules, and the go executable is not on PATH.","commonSituations":"CI/container images that include Hugo but not Go; local machines where Go was never installed or was uninstalled; PATH not updated after installing Go via a version manager; deploying Hugo in environments expecting only pre-built assets.","solutions":["Install Go from https://go.dev/dl/ (or your package manager, e.g. apt/brew) and ensure 'go version' succeeds on PATH.","If you do not need module support, remove the go.mod / avoid module.imports so Hugo does not invoke go.","Pre-vendor dependencies with 'hugo vendor' on a machine that has Go, then build without Go elsewhere."],"exampleFix":"// verify Go is available before building\n// before: go.mod present, no go binary -> error\n// after\ngo version   // ensure prints a version\nhugo mod tidy\nhugo","handlingStrategy":"validation","validationCode":"// preflight: assert go is on PATH when a go.mod exists\nif _, err := os.Stat(filepath.Join(workDir, \"go.mod\")); err == nil {\n    if _, err := exec.LookPath(\"go\"); err != nil {\n        return errors.New(\"go.mod present but 'go' binary not found on PATH; install Go\")\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install Go in CI containers that run Hugo with modules.","Pin a Go version in your toolchain (go.mod 'go' directive or go.work).","Run 'go version' as a build precondition."],"tags":["hugo","go-toolchain","environment"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}