init: basic tools
This commit is contained in:
18
output_stdout.go
Normal file
18
output_stdout.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package script
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type StdoutWriter struct{}
|
||||
|
||||
func NewStdoutWriter() *StdoutWriter {
|
||||
return new(StdoutWriter)
|
||||
}
|
||||
|
||||
func (s *StdoutWriter) Write(_ context.Context, in []string) error {
|
||||
_, err := os.Stdout.WriteString(strings.Join(in, ",") + "\n")
|
||||
return err
|
||||
}
|
Reference in New Issue
Block a user