22 lines
315 B
Go
22 lines
315 B
Go
package script
|
|
|
|
import "context"
|
|
|
|
type MemWriter struct {
|
|
rows [][]string
|
|
}
|
|
|
|
func NewMemWriter() *MemWriter {
|
|
return new(MemWriter)
|
|
}
|
|
|
|
func (m *MemWriter) Write(_ context.Context, record []string) error {
|
|
m.rows = append(m.rows, record)
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *MemWriter) Output() [][]string {
|
|
return m.rows
|
|
}
|