format source tree using goimports

This commit is contained in:
Christian Schwarz
2019-03-22 19:41:12 +01:00
parent 5324f29693
commit afed762774
93 changed files with 585 additions and 463 deletions
@@ -5,6 +5,7 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/zrepl/zrepl/zfs"
)
+1 -1
View File
@@ -39,4 +39,4 @@ func (l *L) NewCond() *sync.Cond {
func (l *L) DropWhile(f func()) {
defer l.Unlock().Lock()
f()
}
}
+2 -1
View File
@@ -3,11 +3,12 @@ package util
import (
"bytes"
"encoding/binary"
"github.com/stretchr/testify/assert"
"io"
"reflect"
"testing"
"testing/quick"
"github.com/stretchr/testify/assert"
)
func TestUnchunker(t *testing.T) {
+3 -2
View File
@@ -2,10 +2,11 @@ package util
import (
"context"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestContextWithOptionalDeadline(t *testing.T) {
+5 -5
View File
@@ -101,16 +101,16 @@ func (c *ChainedReader) Read(buf []byte) (n int, err error) {
}
type ByteCounterReader struct {
reader io.ReadCloser
reader io.ReadCloser
// called & accessed synchronously during Read, no external access
cb func(full int64)
cbEvery time.Duration
lastCbAt time.Time
cb func(full int64)
cbEvery time.Duration
lastCbAt time.Time
bytesSinceLastCb int64
// set atomically because it may be read by multiple threads
bytes int64
bytes int64
}
func NewByteCounterReader(reader io.ReadCloser) *ByteCounterReader {
+3 -2
View File
@@ -4,18 +4,19 @@ import (
"bytes"
"context"
"fmt"
"github.com/zrepl/zrepl/util/envconst"
"io"
"os"
"os/exec"
"syscall"
"time"
"github.com/zrepl/zrepl/util/envconst"
)
// An IOCommand exposes a forked process's std(in|out|err) through the io.ReadWriteCloser interface.
type IOCommand struct {
Cmd *exec.Cmd
kill context.CancelFunc
kill context.CancelFunc
Stdin io.WriteCloser
Stdout io.ReadCloser
StderrBuf *bytes.Buffer