Add MarshalBytesWithoutHeaders
This commit is contained in:
1 parent
4d32abefad
commit
90a1c52508
2 files changed
+24
No files matched your search
@@ -149,6 +149,15 @@ func MarshalBytes(in interface{}) (out []byte, err error) {
|
||||
return bufferString.Bytes(), nil
|
||||
}
|
||||
|
||||
// MarshalBytesWithoutHeaders returns the CSV bytes from the interface.
|
||||
func MarshalBytesWithoutHeaders(in interface{}) (out []byte, err error) {
|
||||
bufferString := bytes.NewBuffer(out)
|
||||
if err := MarshalWithoutHeaders(in, bufferString); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return bufferString.Bytes(), nil
|
||||
}
|
||||
|
||||
// Marshal returns the CSV in writer from the interface.
|
||||
func Marshal(in interface{}, out io.Writer) (err error) {
|
||||
writer := getCSVWriter(out)
|
||||
|
||||
Reference in new issue
Block a user