remove unused

This commit is contained in:
James Bardin 2020-11-30 18:02:04 -05:00
parent 1e8537b8d4
commit bdfea50cc8
2 changed files with 0 additions and 36 deletions

View File

@ -46,11 +46,6 @@ var HiddenCommands map[string]struct{}
// Ui is the cli.Ui used for communicating to the outside world.
var Ui cli.Ui
const (
ErrorPrefix = "e:"
OutputPrefix = "o:"
)
func initCommands(
originalWorkingDir string,
config *cliconfig.Config,

View File

@ -1,31 +0,0 @@
package main
import (
"io"
"sync"
)
type synchronizedWriter struct {
io.Writer
mutex *sync.Mutex
}
// synchronizedWriters takes a set of writers and returns wrappers that ensure
// that only one write can be outstanding at a time across the whole set.
func synchronizedWriters(targets ...io.Writer) []io.Writer {
mutex := &sync.Mutex{}
ret := make([]io.Writer, len(targets))
for i, target := range targets {
ret[i] = &synchronizedWriter{
Writer: target,
mutex: mutex,
}
}
return ret
}
func (w *synchronizedWriter) Write(p []byte) (int, error) {
w.mutex.Lock()
defer w.mutex.Unlock()
return w.Writer.Write(p)
}