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
+8 -9
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"
)
@@ -157,14 +156,14 @@ func respondWithError(conn io.Writer, id ErrorId, err error) error {
func inferRequestType(v interface{}) (RequestType, error) {
switch v.(type) {
case ByteStreamRPCProtocolVersionRequest:
return RTProtocolVersionRequest, nil
return RTProtocolVersionRequest, nil
case FilesystemRequest:
return RTFilesystemRequest, nil
return RTFilesystemRequest, nil
case InitialTransferRequest:
return RTInitialTransferRequest, nil
return RTInitialTransferRequest, nil
default:
return 0, errors.New(fmt.Sprintf("cannot infer request type for type '%v'",
reflect.TypeOf(v)))
reflect.TypeOf(v)))
}
}
@@ -182,7 +181,7 @@ func (c ByteStreamRPC) sendRequest(v interface{}) (err error) {
h := RequestHeader{
Type: rt,
Id: genUUID(),
Id: genUUID(),
}
if err = c.encoder.Encode(h); err != nil {
+7 -7
View File
@@ -6,10 +6,10 @@ type RequestId [16]byte
type RequestType uint8
const (
RTProtocolVersionRequest RequestType = 1
RTFilesystemRequest = 16
RTInitialTransferRequest = 17
RTIncrementalTransferRequest = 18
RTProtocolVersionRequest RequestType = 1
RTFilesystemRequest = 16
RTInitialTransferRequest = 17
RTIncrementalTransferRequest = 18
)
type RequestHeader struct {
@@ -56,9 +56,9 @@ const (
type ResponseType uint8
const (
ROK ResponseType = 1
RFilesystems = 2
RChunkedStream = 3
ROK ResponseType = 1
RFilesystems = 2
RChunkedStream = 3
)
type ResponseHeader struct {