mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-15 07:18:04 +00:00
i used this script, a little clunky but it got the job done
```bash
for file in `find . -type f -print | grep '\.go'`; do
sed '1,/^\/\/ limitations under the License.$/d' $file > $file.tmp;
result=`cat $file.tmp`
if [[ result != "" ]]; then
gofmt $file.tmp &> /dev/null;
if [[ $? == 0 ]]; then
mv $file.tmp $file && gofmt -w $file;
else
rm $file.tmp;
fi
else
rm $file.tmp;
fi
done
```
30 lines
566 B
Go
30 lines
566 B
Go
package pilosa
|
|
|
|
import (
|
|
"io"
|
|
|
|
"github.com/molecula/featurebase/v2/logger"
|
|
)
|
|
|
|
// CmdIO holds standard unix inputs and outputs.
|
|
type CmdIO struct {
|
|
Stdin io.Reader
|
|
Stdout io.Writer
|
|
Stderr io.Writer
|
|
logger logger.Logger
|
|
}
|
|
|
|
// NewCmdIO returns a new instance of CmdIO with inputs and outputs set to the
|
|
// arguments.
|
|
func NewCmdIO(stdin io.Reader, stdout, stderr io.Writer) *CmdIO {
|
|
return &CmdIO{
|
|
Stdin: stdin,
|
|
Stdout: stdout,
|
|
Stderr: stderr,
|
|
logger: logger.NewStandardLogger(stderr),
|
|
}
|
|
}
|
|
|
|
func (c *CmdIO) Logger() logger.Logger {
|
|
return c.logger
|
|
}
|