Adjust package order (#487)

* format package order

* format package order

* format package order

* format package order and format code by fmt
This commit is contained in:
田欧
2017-08-22 19:15:01 +05:00
committed by Leonid Bugaev
parent dfb67b4456
commit 16b6a3cc31
17 changed files with 48 additions and 27 deletions
+4 -2
View File
@@ -3,12 +3,14 @@ package main
import (
"net/url"
"encoding/json"
"github.com/buger/goreplay/proto"
"github.com/mattbaird/elastigo/lib"
"log"
"strings"
//"regexp"
"time"
"github.com/buger/goreplay/proto"
"github.com/mattbaird/elastigo/lib"
)
type ESUriErorr struct{}
+2 -1
View File
@@ -24,8 +24,9 @@ import (
"bytes"
"encoding/hex"
"fmt"
"github.com/buger/goreplay/proto"
"os"
"github.com/buger/goreplay/proto"
)
// requestID -> originalToken
+2 -1
View File
@@ -3,7 +3,6 @@ package main
import (
"bytes"
"crypto/rand"
"github.com/buger/goreplay/proto"
"io/ioutil"
_ "log"
"net"
@@ -15,6 +14,8 @@ import (
"sync"
"testing"
"time"
"github.com/buger/goreplay/proto"
)
func TestHTTPClientURLPort(t *testing.T) {
+2 -1
View File
@@ -2,8 +2,9 @@ package main
import (
"bytes"
"github.com/buger/goreplay/proto"
"testing"
"github.com/buger/goreplay/proto"
)
func TestHTTPModifierWithoutConfig(t *testing.T) {
+2 -1
View File
@@ -3,10 +3,11 @@ package main
import (
"bytes"
"compress/gzip"
"github.com/buger/goreplay/proto"
"io/ioutil"
"net/http/httputil"
"strconv"
"github.com/buger/goreplay/proto"
)
func prettifyHTTP(p []byte) []byte {
+2 -1
View File
@@ -1,7 +1,6 @@
package main
import (
"github.com/buger/goreplay/proto"
"io"
"log"
"net/http"
@@ -9,6 +8,8 @@ import (
"strings"
"sync"
"testing"
"github.com/buger/goreplay/proto"
)
func TestHTTPInput(t *testing.T) {
+2 -1
View File
@@ -2,9 +2,10 @@ package main
import (
"encoding/json"
"log"
"github.com/Shopify/sarama"
"github.com/Shopify/sarama/mocks"
"log"
)
// KafkaInput is used for recieving Kafka messages and
+2 -1
View File
@@ -1,9 +1,10 @@
package main
import (
"testing"
"github.com/Shopify/sarama"
"github.com/Shopify/sarama/mocks"
"testing"
)
func TestInputKafkaRAW(t *testing.T) {
+3 -2
View File
@@ -1,11 +1,12 @@
package main
import (
"github.com/buger/goreplay/proto"
raw "github.com/buger/goreplay/raw_socket_listener"
"log"
"net"
"time"
"github.com/buger/goreplay/proto"
raw "github.com/buger/goreplay/raw_socket_listener"
)
// RAWInput used for intercepting traffic for given address
+2 -1
View File
@@ -2,7 +2,6 @@ package main
import (
"bytes"
"github.com/buger/goreplay/proto"
"io"
"io/ioutil"
"log"
@@ -19,6 +18,8 @@ import (
"sync/atomic"
"testing"
"time"
"github.com/buger/goreplay/proto"
)
const testRawExpire = time.Millisecond * 200
+3 -1
View File
@@ -3,8 +3,10 @@ package main
import (
"bytes"
"fmt"
"github.com/Shopify/sarama"
"github.com/buger/goreplay/proto"
"github.com/Shopify/sarama"
)
// KafkaConfig should contains required information to
+2 -1
View File
@@ -4,7 +4,6 @@ import (
"bytes"
"crypto/rand"
"encoding/hex"
"github.com/buger/goreplay/proto"
"io"
"net/http"
"net/http/httptest"
@@ -12,6 +11,8 @@ import (
"sync"
"testing"
"time"
"github.com/buger/goreplay/proto"
)
type fakeServiceCb func(string, int, []byte)
+5 -3
View File
@@ -2,13 +2,15 @@ package main
import (
"encoding/json"
"github.com/Shopify/sarama"
"github.com/Shopify/sarama/mocks"
"github.com/buger/goreplay/proto"
"io"
"log"
"strings"
"time"
"github.com/buger/goreplay/proto"
"github.com/Shopify/sarama"
"github.com/Shopify/sarama/mocks"
)
// KafkaOutput is used for sending payloads to kafka in JSON format.
+2 -1
View File
@@ -1,9 +1,10 @@
package main
import (
"testing"
"github.com/Shopify/sarama"
"github.com/Shopify/sarama/mocks"
"testing"
)
func TestOutputKafkaRAW(t *testing.T) {
+5 -4
View File
@@ -18,6 +18,7 @@ package proto
import (
"bytes"
"github.com/buger/goreplay/byteutils"
)
@@ -348,18 +349,18 @@ func Path(payload []byte) []byte {
if eol > 0 {
if end == -1 || eol < end {
return payload[start : start + eol]
return payload[start : start+eol]
}
} else { // support for legacy clients
eol = bytes.IndexByte(payload[start:], '\n')
if eol > 0 && (end == - 1 || eol < end) {
return payload[start : start + eol]
if eol > 0 && (end == -1 || eol < end) {
return payload[start : start+eol]
}
}
if end < 0 {
return payload[start: len(payload)]
return payload[start:len(payload)]
}
return payload[start : start+end]
+6 -4
View File
@@ -16,10 +16,6 @@ import (
"bytes"
"encoding/binary"
"fmt"
"github.com/buger/goreplay/proto"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
"io"
"log"
"net"
@@ -29,6 +25,12 @@ import (
"strings"
"sync"
"time"
"github.com/buger/goreplay/proto"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
)
var _ = fmt.Println
+2 -1
View File
@@ -5,11 +5,12 @@ import (
"crypto/sha1"
"encoding/binary"
"encoding/hex"
"github.com/buger/goreplay/proto"
"log"
"net"
"strconv"
"time"
"github.com/buger/goreplay/proto"
)
var _ = log.Println