init: basic tools

This commit is contained in:
2025-08-30 22:00:31 +03:00
commit ec5db88f97
13 changed files with 467 additions and 0 deletions

21
output_mem.go Normal file
View File

@@ -0,0 +1,21 @@
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
}