MCPcopy
hub / github.com/TomWright/dasel / NewWriter

Method NewWriter

parsing/format.go:20–30  ·  view source on GitHub ↗

NewWriter creates a new writer for the format.

(options WriterOptions)

Source from the content-addressed store, hash-verified

18
19// NewWriter creates a new writer for the format.
20func (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.
33func (f Format) String() string {

Callers 15

runFunction · 0.80
mustWriterFunction · 0.80
TestIniFunction · 0.80
TestTomlWriter_MoreCasesFunction · 0.80
TestTomlWriter_CompactFunction · 0.80
TestXmlReader_ReadFunction · 0.80
TestXmlWriter_CompactFunction · 0.80

Calls 1

MultiDocumentWriterFunction · 0.85

Tested by 15

mustWriterFunction · 0.64
TestIniFunction · 0.64
TestTomlWriter_MoreCasesFunction · 0.64
TestTomlWriter_CompactFunction · 0.64
TestXmlReader_ReadFunction · 0.64
TestXmlWriter_CompactFunction · 0.64