mirror of
https://github.com/vbatts/tar-split.git
synced 2025-10-25 16:20:57 +00:00
*: mage, drop go1.1{5,6}, module updates, drop vendor
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
16d1376be9
commit
075c33cadf
415 changed files with 180 additions and 214680 deletions
28
mage_color.go
Normal file
28
mage_color.go
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
//go:build mage
|
||||
// +build mage
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/fatih/color"
|
||||
)
|
||||
|
||||
var (
|
||||
ourStdout = cw{c: color.New(color.FgGreen), o: os.Stdout}
|
||||
ourStderr = cw{c: color.New(color.FgRed), o: os.Stderr}
|
||||
)
|
||||
|
||||
// hack around color.Color not implementing Write()
|
||||
type cw struct {
|
||||
c *color.Color
|
||||
o io.Writer
|
||||
}
|
||||
|
||||
func (cw cw) Write(p []byte) (int, error) {
|
||||
i := len(p)
|
||||
_, err := cw.c.Fprint(cw.o, string(p)) // discarding the number of bytes written for now...
|
||||
return i, err
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue