Skip to content

Commit

Permalink
Run goimports on code base
Browse files Browse the repository at this point in the history
  • Loading branch information
mmlb committed Feb 4, 2020
1 parent 80bcf9c commit 9b6b9ea
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 34 deletions.
8 changes: 5 additions & 3 deletions cmd/cnetflow/cnetflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
8 changes: 5 additions & 3 deletions cmd/cnflegacy/cnflegacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
8 changes: 5 additions & 3 deletions cmd/csflow/csflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
8 changes: 5 additions & 3 deletions cmd/goflow/goflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
3 changes: 2 additions & 1 deletion decoders/netflow/netflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
1 change: 1 addition & 0 deletions decoders/netflowlegacy/netflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package netflowlegacy
import (
"bytes"
"fmt"

"github.com/cloudflare/goflow/v3/decoders/utils"
)

Expand Down
3 changes: 2 additions & 1 deletion decoders/netflowlegacy/netflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package netflowlegacy

import (
"bytes"
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

func TestDecodeNetFlowV5(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions decoders/sflow/sflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"errors"
"fmt"

"github.com/cloudflare/goflow/v3/decoders/utils"
)

Expand Down
3 changes: 2 additions & 1 deletion decoders/sflow/sflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package sflow

import (
"bytes"
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

func TestSFlowDecode(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion pb/flow.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions producer/producer_nf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion producer/producer_nflegacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion producer/producer_sf.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{} {
Expand Down
3 changes: 2 additions & 1 deletion producer/producer_test.go
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion transport/transport_test.go
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion utils/metrics.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package utils

import (
"github.com/prometheus/client_golang/prometheus"
"strconv"
"time"

"github.com/prometheus/client_golang/prometheus"
)

var (
Expand Down
9 changes: 5 additions & 4 deletions utils/netflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 2 additions & 1 deletion utils/nflegacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 3 additions & 2 deletions utils/sflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 5 additions & 4 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9b6b9ea

Please sign in to comment.