NewWriter creates a new writer for the format.
(options WriterOptions)
| 18 | |
| 19 | // NewWriter creates a new writer for the format. |
| 20 | func (f Format) NewWriter(options WriterOptions) (Writer, error) { |
| 21 | fn, ok := writers[f] |
| 22 | if !ok { |
| 23 | return nil, fmt.Errorf("unsupported writer file format: %s", f) |
| 24 | } |
| 25 | w, err := fn(options) |
| 26 | if err != nil { |
| 27 | return nil, err |
| 28 | } |
| 29 | return MultiDocumentWriter(w), nil |
| 30 | } |
| 31 | |
| 32 | // String returns the string representation of the format. |
| 33 | func (f Format) String() string { |