-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathinterface.go
More file actions
29 lines (25 loc) · 747 Bytes
/
interface.go
File metadata and controls
29 lines (25 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package csvutil
// Reader provides the interface for reading a single CSV record.
//
// If there is no data left to be read, Read returns (nil, io.EOF).
//
// It is implemented by csv.Reader.
type Reader interface {
Read() ([]string, error)
}
// Writer provides the interface for writing a single CSV record.
//
// It is implemented by csv.Writer.
type Writer interface {
Write([]string) error
}
// Unmarshaler is the interface implemented by types that can unmarshal
// a single record's field description of themselves.
type Unmarshaler interface {
UnmarshalCSV([]byte) error
}
// Marshaler is the interface implemented by types that can marshal themselves
// into valid string.
type Marshaler interface {
MarshalCSV() ([]byte, error)
}