Gofmt megacommit.

This commit is contained in:
Christian Schwarz 2017-04-26 20:25:53 +02:00
parent 9750bf3123
commit d9ecfc8eb4
14 changed files with 130 additions and 137 deletions

View File

@ -1,11 +1,11 @@
package main
import (
yaml "gopkg.in/yaml.v2"
"io/ioutil"
"errors"
"github.com/mitchellh/mapstructure"
"github.com/zrepl/zrepl/zfs"
"errors"
yaml "gopkg.in/yaml.v2"
"io/ioutil"
"strings"
)
@ -110,7 +110,6 @@ func parsePulls(v interface{}) (p []Pull, err error) {
Mapping map[string]string
}, 0)
if err = mapstructure.Decode(v, &asList); err != nil {
return
}

View File

@ -1,8 +1,8 @@
package main
import (
"testing"
"github.com/stretchr/testify/assert"
"testing"
)
func TestSampleConfigFileIsParsedWithoutErrors(t *testing.T) {

View File

@ -1,11 +1,12 @@
package main
import (
"io"
"github.com/zrepl/zrepl/zfs"
"github.com/zrepl/zrepl/model"
"github.com/zrepl/zrepl/rpc"
"github.com/zrepl/zrepl/zfs"
"io"
)
type Handler struct{}
func (h Handler) HandleFilesystemRequest(r rpc.FilesystemRequest) (roots []model.Filesystem, err error) {

View File

@ -1,12 +1,12 @@
package main
import (
"github.com/urfave/cli"
"errors"
"fmt"
"io"
"github.com/zrepl/zrepl/sshbytestream"
"github.com/urfave/cli"
"github.com/zrepl/zrepl/rpc"
"github.com/zrepl/zrepl/sshbytestream"
"io"
)
type Role uint

View File

@ -2,12 +2,11 @@ package rpc
import (
"encoding/json"
"io"
. "github.com/zrepl/zrepl/model"
. "github.com/zrepl/zrepl/util"
"errors"
"fmt"
. "github.com/zrepl/zrepl/model"
. "github.com/zrepl/zrepl/util"
"io"
"reflect"
)

View File

@ -1,17 +1,17 @@
package main
import (
"flag"
"github.com/zrepl/zrepl/model"
"github.com/zrepl/zrepl/sshbytestream"
"github.com/zrepl/zrepl/util"
"flag"
// "bytes"
_ "bufio"
// "strings"
"io"
"fmt"
_ "time"
"io"
"os"
_ "time"
)
func main() {
@ -45,7 +45,6 @@ func main() {
fmt.Fprintf(os.Stderr, "Chunk Count: %d\n", chunker.ChunkCount)
case *mode == "outgoing":
conn, err := sshbytestream.Outgoing("client", model.SSHTransport{
@ -73,7 +72,6 @@ func main() {
os.Exit(0)
default:
panic("unsupported mode!")

View File

@ -1,13 +1,13 @@
package sshbytestream
import (
"bytes"
"context"
"fmt"
"github.com/zrepl/zrepl/model"
"io"
"os"
"os/exec"
"github.com/zrepl/zrepl/model"
"context"
"fmt"
"bytes"
"sync"
)
@ -61,7 +61,6 @@ func Outgoing(name string, remote model.SSHTransport) (conn io.ReadWriteCloser,
return
}
f := ForkedSSHReadWriteCloser{
RemoteStdin: in,
RemoteStdout: out,

View File

@ -1,9 +1,9 @@
package chunking
import (
"io"
"encoding/binary"
"bytes"
"encoding/binary"
"io"
)
var ChunkBufSize uint32 = 32 * 1024
@ -89,7 +89,6 @@ func NewChunkerSized(conn io.Reader, chunkSize uint32) Chunker {
remainingChunkBytes: 0,
payloadBuf: buf,
headerBuf: &bytes.Buffer{},
}
}
@ -113,7 +112,7 @@ func (c *Chunker) Read(b []byte) (n int, err error) {
// Write chunk header
c.headerBuf.Reset()
nextChunkLen := uint32(newPayloadLen);
nextChunkLen := uint32(newPayloadLen)
headerLen := binary.Size(nextChunkLen)
err = binary.Write(c.headerBuf, ChunkHeaderByteOrder, nextChunkLen)
if err != nil {

View File

@ -1,11 +1,11 @@
package zfs
import (
"errors"
"os/exec"
"io"
"bufio"
"errors"
"fmt"
"io"
"os/exec"
)
type DatasetMapping interface {
@ -29,7 +29,6 @@ func (m GlobMapping) Map(source DatasetPath) (target DatasetPath, err error) {
target = make([]string, 0, len(source)+len(m.TargetRoot))
target = append(target, m.TargetRoot...)
for si, sc := range source {
target = append(target, sc)
if si < len(m.PrefixPath) {
@ -100,7 +99,6 @@ func (m ExecMapping) Map(source DatasetPath) (target DatasetPath, err error) {
var stdin io.Writer
var stdout io.Reader
cmd := exec.Command(m.Name, m.Args...)
if stdin, err = cmd.StdinPipe(); err != nil {

View File

@ -1,8 +1,8 @@
package zfs
import (
"testing"
"github.com/stretchr/testify/assert"
"testing"
)
func TestGlobMapping(t *testing.T) {

View File

@ -1,14 +1,14 @@
package zfs
import (
"github.com/zrepl/zrepl/model"
"os/exec"
"bufio"
"strings"
"errors"
"io"
"fmt"
"github.com/zrepl/zrepl/model"
"io"
"io/ioutil"
"os/exec"
"strings"
)
func InitialSend(snapshot string) (io.Reader, error) {

View File

@ -1,8 +1,8 @@
package zfs
import (
"testing"
"github.com/stretchr/testify/assert"
"testing"
)
func TestZFSListHandlesProducesZFSErrorOnNonZeroExit(t *testing.T) {