{"id":"9210167808a36c5e","repo":"docker/cli","slug":"template-parsing-error-w","errorCode":null,"errorMessage":"template parsing error: %w","messagePattern":"template parsing error: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/command/formatter/formatter.go","lineNumber":88,"sourceCode":"\n// Context contains information required by the formatter to print the output as desired.\ntype Context struct {\n\t// Output is the output stream to which the formatted string is written.\n\tOutput io.Writer\n\t// Format is used to choose raw, table or custom format for the output.\n\tFormat Format\n\t// Trunc when set to true will truncate the output of certain fields such as Container ID.\n\tTrunc bool\n\n\t// internal element\n\theader any\n\tbuffer *bytes.Buffer\n}\n\nfunc (c *Context) parseFormat() (*template.Template, error) {\n\ttmpl, err := templates.Parse(c.Format.templateString())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"template parsing error: %w\", err)\n\t}\n\treturn tmpl, nil\n}\n\nfunc (c *Context) postFormat(tmpl *template.Template, subContext SubContext) {\n\tout := c.Output\n\tif out == nil {\n\t\tout = io.Discard\n\t}\n\tif !c.Format.IsTable() {\n\t\t_, _ = c.buffer.WriteTo(out)\n\t\treturn\n\t}\n\n\t// Write column-headers and rows to the tab-writer buffer, then flush the output.\n\ttw := tabwriter.NewWriter(out, 10, 1, 3, ' ', 0)\n\t_ = tmpl.Funcs(templates.HeaderFunctions).Execute(tw, subContext.FullHeader())\n\t_, _ = tw.Write([]byte{'\\n'})","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/command/formatter/formatter.go#L70-L106","documentation":"Error \"template parsing error: %w\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/command/formatter/formatter.go:88 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}