From 356f6cd9184c51e2b69ce26c8e5c2d75be8e26f1 Mon Sep 17 00:00:00 2001 From: Manuel Mendez Date: Mon, 3 Feb 2020 19:10:23 -0500 Subject: [PATCH 1/4] Correctly specify version in go.mod According to semantic-import-versioning doc on the [wiki][1], go modules with version >1 need to specify the version number as part of the package line. Without this fix, this module is not go-gettable when modules are ON. [1]: https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 39a30bc..cae068e 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/cloudflare/goflow +module github.com/cloudflare/goflow/v3 go 1.12 From 80bcf9cfaa3775ac6d72ae4da8d4e9822b992d13 Mon Sep 17 00:00:00 2001 From: Manuel Mendez Date: Tue, 4 Feb 2020 10:13:13 -0500 Subject: [PATCH 2/4] Ensure code base is at v3 A repo is allowed to host more than one module version, the recommended way to do so is to have versioned subdirs. But that is not the only way, tagged versions and branches is fine too. In either case the import paths need to match to version specified in go.mod. Since this repo is obviously not doing the versioned sub-dir route the import paths of all top-level files/first-level directories/packages need to be updated to specify they are for v3. Otherwise it seems like the repo is in a weird mixed version mode. --- cmd/cnetflow/cnetflow.go | 4 ++-- cmd/cnflegacy/cnflegacy.go | 4 ++-- cmd/csflow/csflow.go | 4 ++-- cmd/goflow/goflow.go | 4 ++-- decoders/netflow/netflow.go | 2 +- decoders/netflowlegacy/netflow.go | 2 +- decoders/sflow/sflow.go | 2 +- producer/producer_nf.go | 4 ++-- producer/producer_nflegacy.go | 4 ++-- producer/producer_sf.go | 4 ++-- producer/producer_test.go | 4 ++-- transport/kafka.go | 4 ++-- transport/transport_test.go | 2 +- utils/netflow.go | 6 +++--- utils/nflegacy.go | 6 +++--- utils/sflow.go | 6 +++--- utils/utils.go | 6 +++--- 17 files changed, 34 insertions(+), 34 deletions(-) diff --git a/cmd/cnetflow/cnetflow.go b/cmd/cnetflow/cnetflow.go index 120a937..8b31ad1 100644 --- a/cmd/cnetflow/cnetflow.go +++ b/cmd/cnetflow/cnetflow.go @@ -3,8 +3,8 @@ package main import ( "flag" "fmt" - "github.com/cloudflare/goflow/transport" - "github.com/cloudflare/goflow/utils" + "github.com/cloudflare/goflow/v3/transport" + "github.com/cloudflare/goflow/v3/utils" log "github.com/sirupsen/logrus" "os" "runtime" diff --git a/cmd/cnflegacy/cnflegacy.go b/cmd/cnflegacy/cnflegacy.go index dd8a454..ef312d4 100644 --- a/cmd/cnflegacy/cnflegacy.go +++ b/cmd/cnflegacy/cnflegacy.go @@ -3,8 +3,8 @@ package main import ( "flag" "fmt" - "github.com/cloudflare/goflow/transport" - "github.com/cloudflare/goflow/utils" + "github.com/cloudflare/goflow/v3/transport" + "github.com/cloudflare/goflow/v3/utils" log "github.com/sirupsen/logrus" "os" "runtime" diff --git a/cmd/csflow/csflow.go b/cmd/csflow/csflow.go index 18e8878..6f8a3b3 100644 --- a/cmd/csflow/csflow.go +++ b/cmd/csflow/csflow.go @@ -3,8 +3,8 @@ package main import ( "flag" "fmt" - "github.com/cloudflare/goflow/transport" - "github.com/cloudflare/goflow/utils" + "github.com/cloudflare/goflow/v3/transport" + "github.com/cloudflare/goflow/v3/utils" log "github.com/sirupsen/logrus" "os" "runtime" diff --git a/cmd/goflow/goflow.go b/cmd/goflow/goflow.go index af12937..e42011c 100644 --- a/cmd/goflow/goflow.go +++ b/cmd/goflow/goflow.go @@ -3,8 +3,8 @@ package main import ( "flag" "fmt" - "github.com/cloudflare/goflow/transport" - "github.com/cloudflare/goflow/utils" + "github.com/cloudflare/goflow/v3/transport" + "github.com/cloudflare/goflow/v3/utils" log "github.com/sirupsen/logrus" "os" "runtime" diff --git a/decoders/netflow/netflow.go b/decoders/netflow/netflow.go index e8b53fb..24c1fdb 100644 --- a/decoders/netflow/netflow.go +++ b/decoders/netflow/netflow.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/binary" "fmt" - "github.com/cloudflare/goflow/decoders/utils" + "github.com/cloudflare/goflow/v3/decoders/utils" "sync" ) diff --git a/decoders/netflowlegacy/netflow.go b/decoders/netflowlegacy/netflow.go index 93741fa..0836779 100644 --- a/decoders/netflowlegacy/netflow.go +++ b/decoders/netflowlegacy/netflow.go @@ -3,7 +3,7 @@ package netflowlegacy import ( "bytes" "fmt" - "github.com/cloudflare/goflow/decoders/utils" + "github.com/cloudflare/goflow/v3/decoders/utils" ) type ErrorVersion struct { diff --git a/decoders/sflow/sflow.go b/decoders/sflow/sflow.go index a8ef311..2183294 100644 --- a/decoders/sflow/sflow.go +++ b/decoders/sflow/sflow.go @@ -4,7 +4,7 @@ import ( "bytes" "errors" "fmt" - "github.com/cloudflare/goflow/decoders/utils" + "github.com/cloudflare/goflow/v3/decoders/utils" ) const ( diff --git a/producer/producer_nf.go b/producer/producer_nf.go index 3df89a2..c195e41 100644 --- a/producer/producer_nf.go +++ b/producer/producer_nf.go @@ -5,8 +5,8 @@ import ( "encoding/binary" "errors" "fmt" - "github.com/cloudflare/goflow/decoders/netflow" - flowmessage "github.com/cloudflare/goflow/pb" + "github.com/cloudflare/goflow/v3/decoders/netflow" + flowmessage "github.com/cloudflare/goflow/v3/pb" "net" "sync" "time" diff --git a/producer/producer_nflegacy.go b/producer/producer_nflegacy.go index 5dcd422..2c5ba61 100644 --- a/producer/producer_nflegacy.go +++ b/producer/producer_nflegacy.go @@ -3,8 +3,8 @@ package producer import ( "encoding/binary" "errors" - "github.com/cloudflare/goflow/decoders/netflowlegacy" - flowmessage "github.com/cloudflare/goflow/pb" + "github.com/cloudflare/goflow/v3/decoders/netflowlegacy" + flowmessage "github.com/cloudflare/goflow/v3/pb" "net" ) diff --git a/producer/producer_sf.go b/producer/producer_sf.go index 963147e..c77fa41 100644 --- a/producer/producer_sf.go +++ b/producer/producer_sf.go @@ -3,8 +3,8 @@ package producer import ( "encoding/binary" "errors" - "github.com/cloudflare/goflow/decoders/sflow" - flowmessage "github.com/cloudflare/goflow/pb" + "github.com/cloudflare/goflow/v3/decoders/sflow" + flowmessage "github.com/cloudflare/goflow/v3/pb" "net" ) diff --git a/producer/producer_test.go b/producer/producer_test.go index f584ba9..193d248 100644 --- a/producer/producer_test.go +++ b/producer/producer_test.go @@ -1,8 +1,8 @@ package producer import ( - "github.com/cloudflare/goflow/decoders/netflow" - "github.com/cloudflare/goflow/decoders/sflow" + "github.com/cloudflare/goflow/v3/decoders/netflow" + "github.com/cloudflare/goflow/v3/decoders/sflow" "github.com/stretchr/testify/assert" "testing" ) diff --git a/transport/kafka.go b/transport/kafka.go index c0aade8..0dfd408 100644 --- a/transport/kafka.go +++ b/transport/kafka.go @@ -6,8 +6,8 @@ import ( "fmt" "strings" - flowmessage "github.com/cloudflare/goflow/pb" - "github.com/cloudflare/goflow/utils" + flowmessage "github.com/cloudflare/goflow/v3/pb" + "github.com/cloudflare/goflow/v3/utils" proto "github.com/golang/protobuf/proto" //"github.com/golang/protobuf/descriptor" diff --git a/transport/transport_test.go b/transport/transport_test.go index 0791e0a..bf72faa 100644 --- a/transport/transport_test.go +++ b/transport/transport_test.go @@ -1,7 +1,7 @@ package transport import ( - flowmessage "github.com/cloudflare/goflow/pb" + flowmessage "github.com/cloudflare/goflow/v3/pb" "github.com/stretchr/testify/assert" "testing" ) diff --git a/utils/netflow.go b/utils/netflow.go index d24dd36..3cef534 100644 --- a/utils/netflow.go +++ b/utils/netflow.go @@ -3,9 +3,9 @@ package utils import ( "bytes" "encoding/json" - "github.com/cloudflare/goflow/decoders/netflow" - flowmessage "github.com/cloudflare/goflow/pb" - "github.com/cloudflare/goflow/producer" + "github.com/cloudflare/goflow/v3/decoders/netflow" + flowmessage "github.com/cloudflare/goflow/v3/pb" + "github.com/cloudflare/goflow/v3/producer" "github.com/prometheus/client_golang/prometheus" "net/http" "strconv" diff --git a/utils/nflegacy.go b/utils/nflegacy.go index 5d48c4e..8130963 100644 --- a/utils/nflegacy.go +++ b/utils/nflegacy.go @@ -2,9 +2,9 @@ package utils import ( "bytes" - "github.com/cloudflare/goflow/decoders/netflowlegacy" - flowmessage "github.com/cloudflare/goflow/pb" - "github.com/cloudflare/goflow/producer" + "github.com/cloudflare/goflow/v3/decoders/netflowlegacy" + flowmessage "github.com/cloudflare/goflow/v3/pb" + "github.com/cloudflare/goflow/v3/producer" "github.com/prometheus/client_golang/prometheus" "time" ) diff --git a/utils/sflow.go b/utils/sflow.go index 74a5243..11c3519 100644 --- a/utils/sflow.go +++ b/utils/sflow.go @@ -2,9 +2,9 @@ package utils import ( "bytes" - "github.com/cloudflare/goflow/decoders/sflow" - flowmessage "github.com/cloudflare/goflow/pb" - "github.com/cloudflare/goflow/producer" + "github.com/cloudflare/goflow/v3/decoders/sflow" + flowmessage "github.com/cloudflare/goflow/v3/pb" + "github.com/cloudflare/goflow/v3/producer" "github.com/prometheus/client_golang/prometheus" "net" "time" diff --git a/utils/utils.go b/utils/utils.go index 543a220..c72860e 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -4,9 +4,9 @@ import ( "encoding/binary" "errors" "fmt" - "github.com/cloudflare/goflow/decoders" - "github.com/cloudflare/goflow/decoders/netflow" - flowmessage "github.com/cloudflare/goflow/pb" + "github.com/cloudflare/goflow/v3/decoders" + "github.com/cloudflare/goflow/v3/decoders/netflow" + flowmessage "github.com/cloudflare/goflow/v3/pb" reuseport "github.com/libp2p/go-reuseport" "github.com/prometheus/client_golang/prometheus" "net" From 9b6b9eac50d39a2d985f005592e2bfc8e965f7cf Mon Sep 17 00:00:00 2001 From: Manuel Mendez Date: Tue, 4 Feb 2020 10:17:54 -0500 Subject: [PATCH 3/4] Run goimports on code base --- cmd/cnetflow/cnetflow.go | 8 +++++--- cmd/cnflegacy/cnflegacy.go | 8 +++++--- cmd/csflow/csflow.go | 8 +++++--- cmd/goflow/goflow.go | 8 +++++--- decoders/netflow/netflow.go | 3 ++- decoders/netflowlegacy/netflow.go | 1 + decoders/netflowlegacy/netflow_test.go | 3 ++- decoders/sflow/sflow.go | 1 + decoders/sflow/sflow_test.go | 3 ++- pb/flow.pb.go | 3 ++- producer/producer_nf.go | 5 +++-- producer/producer_nflegacy.go | 3 ++- producer/producer_sf.go | 3 ++- producer/producer_test.go | 3 ++- transport/transport_test.go | 3 ++- utils/metrics.go | 3 ++- utils/netflow.go | 9 +++++---- utils/nflegacy.go | 3 ++- utils/sflow.go | 5 +++-- utils/utils.go | 9 +++++---- 20 files changed, 58 insertions(+), 34 deletions(-) diff --git a/cmd/cnetflow/cnetflow.go b/cmd/cnetflow/cnetflow.go index 8b31ad1..5b5222b 100644 --- a/cmd/cnetflow/cnetflow.go +++ b/cmd/cnetflow/cnetflow.go @@ -3,14 +3,16 @@ package main import ( "flag" "fmt" + "os" + "runtime" + "github.com/cloudflare/goflow/v3/transport" "github.com/cloudflare/goflow/v3/utils" log "github.com/sirupsen/logrus" - "os" - "runtime" - "github.com/prometheus/client_golang/prometheus/promhttp" "net/http" + + "github.com/prometheus/client_golang/prometheus/promhttp" ) var ( diff --git a/cmd/cnflegacy/cnflegacy.go b/cmd/cnflegacy/cnflegacy.go index ef312d4..51b641d 100644 --- a/cmd/cnflegacy/cnflegacy.go +++ b/cmd/cnflegacy/cnflegacy.go @@ -3,14 +3,16 @@ package main import ( "flag" "fmt" + "os" + "runtime" + "github.com/cloudflare/goflow/v3/transport" "github.com/cloudflare/goflow/v3/utils" log "github.com/sirupsen/logrus" - "os" - "runtime" - "github.com/prometheus/client_golang/prometheus/promhttp" "net/http" + + "github.com/prometheus/client_golang/prometheus/promhttp" ) var ( diff --git a/cmd/csflow/csflow.go b/cmd/csflow/csflow.go index 6f8a3b3..f2a2ea5 100644 --- a/cmd/csflow/csflow.go +++ b/cmd/csflow/csflow.go @@ -3,14 +3,16 @@ package main import ( "flag" "fmt" + "os" + "runtime" + "github.com/cloudflare/goflow/v3/transport" "github.com/cloudflare/goflow/v3/utils" log "github.com/sirupsen/logrus" - "os" - "runtime" - "github.com/prometheus/client_golang/prometheus/promhttp" "net/http" + + "github.com/prometheus/client_golang/prometheus/promhttp" ) var ( diff --git a/cmd/goflow/goflow.go b/cmd/goflow/goflow.go index e42011c..9c6e9d7 100644 --- a/cmd/goflow/goflow.go +++ b/cmd/goflow/goflow.go @@ -3,15 +3,17 @@ package main import ( "flag" "fmt" + "os" + "runtime" + "github.com/cloudflare/goflow/v3/transport" "github.com/cloudflare/goflow/v3/utils" log "github.com/sirupsen/logrus" - "os" - "runtime" - "github.com/prometheus/client_golang/prometheus/promhttp" "net/http" + "github.com/prometheus/client_golang/prometheus/promhttp" + "sync" ) diff --git a/decoders/netflow/netflow.go b/decoders/netflow/netflow.go index 24c1fdb..3a415d2 100644 --- a/decoders/netflow/netflow.go +++ b/decoders/netflow/netflow.go @@ -4,8 +4,9 @@ import ( "bytes" "encoding/binary" "fmt" - "github.com/cloudflare/goflow/v3/decoders/utils" "sync" + + "github.com/cloudflare/goflow/v3/decoders/utils" ) type FlowBaseTemplateSet map[uint16]map[uint32]map[uint16]interface{} diff --git a/decoders/netflowlegacy/netflow.go b/decoders/netflowlegacy/netflow.go index 0836779..fdeca7b 100644 --- a/decoders/netflowlegacy/netflow.go +++ b/decoders/netflowlegacy/netflow.go @@ -3,6 +3,7 @@ package netflowlegacy import ( "bytes" "fmt" + "github.com/cloudflare/goflow/v3/decoders/utils" ) diff --git a/decoders/netflowlegacy/netflow_test.go b/decoders/netflowlegacy/netflow_test.go index a72f178..076db5d 100644 --- a/decoders/netflowlegacy/netflow_test.go +++ b/decoders/netflowlegacy/netflow_test.go @@ -2,8 +2,9 @@ package netflowlegacy import ( "bytes" - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestDecodeNetFlowV5(t *testing.T) { diff --git a/decoders/sflow/sflow.go b/decoders/sflow/sflow.go index 2183294..5208809 100644 --- a/decoders/sflow/sflow.go +++ b/decoders/sflow/sflow.go @@ -4,6 +4,7 @@ import ( "bytes" "errors" "fmt" + "github.com/cloudflare/goflow/v3/decoders/utils" ) diff --git a/decoders/sflow/sflow_test.go b/decoders/sflow/sflow_test.go index 68e0291..195aa9a 100644 --- a/decoders/sflow/sflow_test.go +++ b/decoders/sflow/sflow_test.go @@ -2,8 +2,9 @@ package sflow import ( "bytes" - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) func TestSFlowDecode(t *testing.T) { diff --git a/pb/flow.pb.go b/pb/flow.pb.go index 9bc035b..874ed38 100644 --- a/pb/flow.pb.go +++ b/pb/flow.pb.go @@ -5,8 +5,9 @@ package flowprotob import ( fmt "fmt" - proto "github.com/golang/protobuf/proto" math "math" + + proto "github.com/golang/protobuf/proto" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/producer/producer_nf.go b/producer/producer_nf.go index c195e41..263a0c5 100644 --- a/producer/producer_nf.go +++ b/producer/producer_nf.go @@ -5,11 +5,12 @@ import ( "encoding/binary" "errors" "fmt" - "github.com/cloudflare/goflow/v3/decoders/netflow" - flowmessage "github.com/cloudflare/goflow/v3/pb" "net" "sync" "time" + + "github.com/cloudflare/goflow/v3/decoders/netflow" + flowmessage "github.com/cloudflare/goflow/v3/pb" ) type SamplingRateSystem interface { diff --git a/producer/producer_nflegacy.go b/producer/producer_nflegacy.go index 2c5ba61..990da0e 100644 --- a/producer/producer_nflegacy.go +++ b/producer/producer_nflegacy.go @@ -3,9 +3,10 @@ package producer import ( "encoding/binary" "errors" + "net" + "github.com/cloudflare/goflow/v3/decoders/netflowlegacy" flowmessage "github.com/cloudflare/goflow/v3/pb" - "net" ) func ConvertNetFlowLegacyRecord(baseTime uint32, uptime uint32, record netflowlegacy.RecordsNetFlowV5) *flowmessage.FlowMessage { diff --git a/producer/producer_sf.go b/producer/producer_sf.go index c77fa41..12e5212 100644 --- a/producer/producer_sf.go +++ b/producer/producer_sf.go @@ -3,9 +3,10 @@ package producer import ( "encoding/binary" "errors" + "net" + "github.com/cloudflare/goflow/v3/decoders/sflow" flowmessage "github.com/cloudflare/goflow/v3/pb" - "net" ) func GetSFlowFlowSamples(packet *sflow.Packet) []interface{} { diff --git a/producer/producer_test.go b/producer/producer_test.go index 193d248..fcefb3e 100644 --- a/producer/producer_test.go +++ b/producer/producer_test.go @@ -1,10 +1,11 @@ package producer import ( + "testing" + "github.com/cloudflare/goflow/v3/decoders/netflow" "github.com/cloudflare/goflow/v3/decoders/sflow" "github.com/stretchr/testify/assert" - "testing" ) func TestProcessMessageNetFlow(t *testing.T) { diff --git a/transport/transport_test.go b/transport/transport_test.go index bf72faa..f092cff 100644 --- a/transport/transport_test.go +++ b/transport/transport_test.go @@ -1,9 +1,10 @@ package transport import ( + "testing" + flowmessage "github.com/cloudflare/goflow/v3/pb" "github.com/stretchr/testify/assert" - "testing" ) func TestHash(t *testing.T) { diff --git a/utils/metrics.go b/utils/metrics.go index 216f013..585923c 100644 --- a/utils/metrics.go +++ b/utils/metrics.go @@ -1,9 +1,10 @@ package utils import ( - "github.com/prometheus/client_golang/prometheus" "strconv" "time" + + "github.com/prometheus/client_golang/prometheus" ) var ( diff --git a/utils/netflow.go b/utils/netflow.go index 3cef534..6fe2935 100644 --- a/utils/netflow.go +++ b/utils/netflow.go @@ -3,14 +3,15 @@ package utils import ( "bytes" "encoding/json" - "github.com/cloudflare/goflow/v3/decoders/netflow" - flowmessage "github.com/cloudflare/goflow/v3/pb" - "github.com/cloudflare/goflow/v3/producer" - "github.com/prometheus/client_golang/prometheus" "net/http" "strconv" "sync" "time" + + "github.com/cloudflare/goflow/v3/decoders/netflow" + flowmessage "github.com/cloudflare/goflow/v3/pb" + "github.com/cloudflare/goflow/v3/producer" + "github.com/prometheus/client_golang/prometheus" ) type TemplateSystem struct { diff --git a/utils/nflegacy.go b/utils/nflegacy.go index 8130963..124216c 100644 --- a/utils/nflegacy.go +++ b/utils/nflegacy.go @@ -2,11 +2,12 @@ package utils import ( "bytes" + "time" + "github.com/cloudflare/goflow/v3/decoders/netflowlegacy" flowmessage "github.com/cloudflare/goflow/v3/pb" "github.com/cloudflare/goflow/v3/producer" "github.com/prometheus/client_golang/prometheus" - "time" ) type StateNFLegacy struct { diff --git a/utils/sflow.go b/utils/sflow.go index 11c3519..ef62805 100644 --- a/utils/sflow.go +++ b/utils/sflow.go @@ -2,12 +2,13 @@ package utils import ( "bytes" + "net" + "time" + "github.com/cloudflare/goflow/v3/decoders/sflow" flowmessage "github.com/cloudflare/goflow/v3/pb" "github.com/cloudflare/goflow/v3/producer" "github.com/prometheus/client_golang/prometheus" - "net" - "time" ) type StateSFlow struct { diff --git a/utils/utils.go b/utils/utils.go index c72860e..3c297fd 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -4,14 +4,15 @@ import ( "encoding/binary" "errors" "fmt" - "github.com/cloudflare/goflow/v3/decoders" + "net" + "strconv" + "time" + + decoder "github.com/cloudflare/goflow/v3/decoders" "github.com/cloudflare/goflow/v3/decoders/netflow" flowmessage "github.com/cloudflare/goflow/v3/pb" reuseport "github.com/libp2p/go-reuseport" "github.com/prometheus/client_golang/prometheus" - "net" - "strconv" - "time" ) func GetServiceAddresses(srv string) (addrs []string, err error) { From ac93d0746b232c8bb184c625875d39de91f53ac9 Mon Sep 17 00:00:00 2001 From: Manuel Mendez Date: Tue, 4 Feb 2020 10:22:17 -0500 Subject: [PATCH 4/4] Show import blocks some love Regrouping the imports becuase there was no obvious reason to seprate them. Also removed a commented out import, because that is what git is for :D. --- cmd/cnetflow/cnetflow.go | 6 ++---- cmd/cnflegacy/cnflegacy.go | 6 ++---- cmd/csflow/csflow.go | 6 ++---- cmd/goflow/goflow.go | 9 +++------ transport/kafka.go | 13 +++++-------- 5 files changed, 14 insertions(+), 26 deletions(-) diff --git a/cmd/cnetflow/cnetflow.go b/cmd/cnetflow/cnetflow.go index 5b5222b..f8780fc 100644 --- a/cmd/cnetflow/cnetflow.go +++ b/cmd/cnetflow/cnetflow.go @@ -3,16 +3,14 @@ package main import ( "flag" "fmt" + "net/http" "os" "runtime" "github.com/cloudflare/goflow/v3/transport" "github.com/cloudflare/goflow/v3/utils" - log "github.com/sirupsen/logrus" - - "net/http" - "github.com/prometheus/client_golang/prometheus/promhttp" + log "github.com/sirupsen/logrus" ) var ( diff --git a/cmd/cnflegacy/cnflegacy.go b/cmd/cnflegacy/cnflegacy.go index 51b641d..722d559 100644 --- a/cmd/cnflegacy/cnflegacy.go +++ b/cmd/cnflegacy/cnflegacy.go @@ -3,16 +3,14 @@ package main import ( "flag" "fmt" + "net/http" "os" "runtime" "github.com/cloudflare/goflow/v3/transport" "github.com/cloudflare/goflow/v3/utils" - log "github.com/sirupsen/logrus" - - "net/http" - "github.com/prometheus/client_golang/prometheus/promhttp" + log "github.com/sirupsen/logrus" ) var ( diff --git a/cmd/csflow/csflow.go b/cmd/csflow/csflow.go index f2a2ea5..92e3e40 100644 --- a/cmd/csflow/csflow.go +++ b/cmd/csflow/csflow.go @@ -3,16 +3,14 @@ package main import ( "flag" "fmt" + "net/http" "os" "runtime" "github.com/cloudflare/goflow/v3/transport" "github.com/cloudflare/goflow/v3/utils" - log "github.com/sirupsen/logrus" - - "net/http" - "github.com/prometheus/client_golang/prometheus/promhttp" + log "github.com/sirupsen/logrus" ) var ( diff --git a/cmd/goflow/goflow.go b/cmd/goflow/goflow.go index 9c6e9d7..5c8afad 100644 --- a/cmd/goflow/goflow.go +++ b/cmd/goflow/goflow.go @@ -3,18 +3,15 @@ package main import ( "flag" "fmt" + "net/http" "os" "runtime" + "sync" "github.com/cloudflare/goflow/v3/transport" "github.com/cloudflare/goflow/v3/utils" - log "github.com/sirupsen/logrus" - - "net/http" - "github.com/prometheus/client_golang/prometheus/promhttp" - - "sync" + log "github.com/sirupsen/logrus" ) var ( diff --git a/transport/kafka.go b/transport/kafka.go index 0dfd408..ac364b6 100644 --- a/transport/kafka.go +++ b/transport/kafka.go @@ -3,20 +3,17 @@ package transport import ( "crypto/tls" "crypto/x509" - "fmt" - "strings" - - flowmessage "github.com/cloudflare/goflow/v3/pb" - "github.com/cloudflare/goflow/v3/utils" - proto "github.com/golang/protobuf/proto" - - //"github.com/golang/protobuf/descriptor" "errors" "flag" + "fmt" "os" "reflect" + "strings" sarama "github.com/Shopify/sarama" + flowmessage "github.com/cloudflare/goflow/v3/pb" + "github.com/cloudflare/goflow/v3/utils" + proto "github.com/golang/protobuf/proto" ) var (