mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
fmt fixes
This commit is contained in:
@@ -5,14 +5,14 @@ package main
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"io"
|
||||
"runtime"
|
||||
_ "runtime/debug"
|
||||
"runtime/pprof"
|
||||
"syscall"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -56,16 +56,16 @@ func main() {
|
||||
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
|
||||
go func(){
|
||||
<- c
|
||||
go func() {
|
||||
<-c
|
||||
|
||||
for _, p := range Plugins.All {
|
||||
for _, p := range Plugins.All {
|
||||
if cp, ok := p.(io.Closer); ok {
|
||||
cp.Close()
|
||||
}
|
||||
}
|
||||
|
||||
os.Exit(1)
|
||||
os.Exit(1)
|
||||
}()
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -10,9 +10,9 @@ import (
|
||||
"runtime/debug"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
"sync"
|
||||
)
|
||||
|
||||
var httpMu sync.Mutex
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ func (i *RAWInput) listen(address string) {
|
||||
|
||||
ch := i.listener.Receiver()
|
||||
|
||||
go func(){
|
||||
go func() {
|
||||
for {
|
||||
select {
|
||||
case <-i.quit:
|
||||
|
||||
+3
-3
@@ -4,19 +4,19 @@ import (
|
||||
"io"
|
||||
"reflect"
|
||||
"strings"
|
||||
"time"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
// InOutPlugins struct for holding references to plugins
|
||||
type InOutPlugins struct {
|
||||
Inputs []io.Reader
|
||||
Outputs []io.Writer
|
||||
All []interface{}
|
||||
All []interface{}
|
||||
}
|
||||
|
||||
|
||||
var pluginMu sync.Mutex
|
||||
|
||||
// Plugins holds all the plugin objects
|
||||
var Plugins *InOutPlugins = new(InOutPlugins)
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ type Listener struct {
|
||||
|
||||
messageExpire time.Duration
|
||||
|
||||
conn net.PacketConn
|
||||
conn net.PacketConn
|
||||
pcapHandles []*pcap.Handle
|
||||
|
||||
quit chan bool
|
||||
|
||||
Reference in New Issue
Block a user