code: func (f *JSONYamlPrintFlags) ToPrinter(outputFormat string) (printers.ResourcePrinter, error) {
  	var printer printers.ResourcePrinter
  
  	outputFormat = strings.ToLower(outputFormat)
  	switch outputFormat {
  	case "json":
  		printer = &printers.JSONPrinter{}
  	case "yaml":
  		printer = &printers.YAMLPrinter{}
  	default:
  		return nil, NoCompatiblePrinterError{OutputFormat: &outputFormat, AllowedFormats: f.AllowedFormats()}
  	}
  
  	return printer, nil
  }
docs: // ToPrinter receives an outputFormat and returns a printer capable of
  // handling --output=(yaml|json) printing.
  // Returns false if the specified outputFormat does not match a supported format.
  // Supported Format types can be found in pkg/printers/printers.go