{"record":{"id":"ed207ad85cc3b9c9","repo":"dagger/dagger","slug":"get-dependency-template-w","errorCode":null,"errorMessage":"get dependency template: %w","messagePattern":"get dependency template: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/codegen/generator/go/generator.go","lineNumber":173,"sourceCode":"\tdepNames []string,\n) error {\n\t// When generating a standalone client, dep files live inside the client\n\t// sub-module directory.  We need to resolve imports relative to that\n\t// directory so that goimports can find packages like\n\t// dagger.io/dagger/querybuilder that are declared in the client's go.mod\n\t// (not in the parent module's go.mod).\n\timportResolutionDir := cfg.OutputDir\n\tif cfg.ClientConfig != nil && cfg.ClientConfig.ClientDir != \"\" {\n\t\timportResolutionDir = filepath.Join(cfg.OutputDir, cfg.ClientConfig.ClientDir)\n\t}\n\n\tfor _, depName := range depNames {\n\t\tdepSchema := schema.Include(depName)\n\n\t\tfuncs := templates.GoTemplateFuncs(ctx, depSchema, schema, schemaVersion, cfg, pkg, fset, pass)\n\t\ttmpl, err := templates.DepTemplate(funcs)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"get dependency template: %w\", err)\n\t\t}\n\n\t\tdt, err := renderFile(importResolutionDir, depSchema, schemaVersion, pkgInfo, tmpl)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"render dependency file for %q: %w\", depName, err)\n\t\t}\n\t\tif dt == nil {\n\t\t\t// no types for this dependency, skip\n\t\t\tcontinue\n\t\t}\n\n\t\t// Convert dep name to kebab-case for the filename, e.g. \"myDep\" -> \"my-dep.gen.go\"\n\t\tdepFileName := strcase.ToKebab(depName) + \".gen.go\"\n\t\tdepFilePath := filepath.Join(internalDaggerDir, depFileName)\n\n\t\t// Special case for client generation, we want to write the file in the specified client directory.\n\t\tif cfg.ClientConfig != nil && cfg.ClientConfig.ClientDir != \"\" {\n\t\t\tdepFilePath = filepath.Join(cfg.ClientConfig.ClientDir, depFileName)","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/cmd/codegen/generator/go/generator.go#L155-L191","documentation":"Wrap from generateDependencyFiles when rendering an individual dependency's code files fails — typically template execution or goimports processing for that dependency's schema. Aborts generation of the remaining dependency files.","triggerScenarios":"Thrown at cmd/codegen/generator/go/generator.go:173 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error for the failing dependency/template","Validate the dependency's schema and generated import paths","Ensure the go toolchain/goimports is available for import resolution"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}