code: func (i *TemplateInspector) Inspect(typedElement interface{}, rawElement []byte) error {
  	buffer := new(bytes.Buffer)
  	if err := i.tmpl.Execute(buffer, typedElement); err != nil {
  		if rawElement == nil {
  			return errors.Errorf("Template parsing error: %v", err)
  		}
  		return i.tryRawInspectFallback(rawElement)
  	}
  	i.buffer.Write(buffer.Bytes())
  	i.buffer.WriteByte('\n')
  	return nil
  }
docs: // Inspect executes the inspect template.
  // It decodes the raw element into a map if the initial execution fails.
  // This allows docker cli to parse inspect structs injected with Swarm fields.