diff --git a/socketserver/cmd/ffzsocketserver/console.go b/socketserver/cmd/ffzsocketserver/console.go index b3a77b0c..5d3063d9 100644 --- a/socketserver/cmd/ffzsocketserver/console.go +++ b/socketserver/cmd/ffzsocketserver/console.go @@ -1,13 +1,14 @@ package main import ( - "../../server" "fmt" - "github.com/abiosoft/ishell" - "github.com/gorilla/websocket" "runtime" "strconv" "strings" + + "../../server" + "github.com/abiosoft/ishell" + "github.com/gorilla/websocket" ) func commandLineConsole() { diff --git a/socketserver/cmd/ffzsocketserver/socketserver.go b/socketserver/cmd/ffzsocketserver/socketserver.go index 8b56d707..1d67bddc 100644 --- a/socketserver/cmd/ffzsocketserver/socketserver.go +++ b/socketserver/cmd/ffzsocketserver/socketserver.go @@ -1,7 +1,6 @@ package main // import "bitbucket.org/stendec/frankerfacez/socketserver/cmd/ffzsocketserver" import ( - "../../server" "encoding/json" "flag" "fmt" @@ -9,6 +8,8 @@ import ( "log" "net/http" "os" + + "../../server" ) import _ "net/http/pprof" diff --git a/socketserver/cmd/mergecounts/mergecounts.go b/socketserver/cmd/mergecounts/mergecounts.go index 4eff882f..8ce8b307 100644 --- a/socketserver/cmd/mergecounts/mergecounts.go +++ b/socketserver/cmd/mergecounts/mergecounts.go @@ -1,13 +1,14 @@ package main import ( - "../../server" "encoding/gob" "flag" "fmt" - "github.com/clarkduvall/hyperloglog" "net/http" "os" + + "../../server" + "github.com/clarkduvall/hyperloglog" ) var SERVERS = []string{ diff --git a/socketserver/cmd/statsweb/html.go b/socketserver/cmd/statsweb/html.go index a2bca5d4..4cbdf89c 100644 --- a/socketserver/cmd/statsweb/html.go +++ b/socketserver/cmd/statsweb/html.go @@ -1,10 +1,11 @@ package main import ( - "bitbucket.org/stendec/frankerfacez/socketserver/server" "html/template" "net/http" "time" + + "bitbucket.org/stendec/frankerfacez/socketserver/server" ) type CalendarData struct { diff --git a/socketserver/cmd/statsweb/servers.go b/socketserver/cmd/statsweb/servers.go index eef0e47b..da3f3dfe 100644 --- a/socketserver/cmd/statsweb/servers.go +++ b/socketserver/cmd/statsweb/servers.go @@ -1,17 +1,18 @@ package main import ( - "time" - "io" - "fmt" - "os" - "net/http" - "errors" - "sync" - "github.com/hashicorp/golang-lru" - "github.com/clarkduvall/hyperloglog" - "bitbucket.org/stendec/frankerfacez/socketserver/server" "encoding/gob" + "errors" + "fmt" + "io" + "net/http" + "os" + "sync" + "time" + + "bitbucket.org/stendec/frankerfacez/socketserver/server" + "github.com/clarkduvall/hyperloglog" + "github.com/hashicorp/golang-lru" ) type serverFilter struct { diff --git a/socketserver/server/backend.go b/socketserver/server/backend.go index 55ccf9f1..5bb4d960 100644 --- a/socketserver/server/backend.go +++ b/socketserver/server/backend.go @@ -6,8 +6,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/pmylund/go-cache" - "golang.org/x/crypto/nacl/box" "io/ioutil" "log" "net/http" @@ -16,6 +14,9 @@ import ( "strings" "sync" "time" + + "github.com/pmylund/go-cache" + "golang.org/x/crypto/nacl/box" ) const bPathAnnounceStartup = "/startup" diff --git a/socketserver/server/backend_test.go b/socketserver/server/backend_test.go index 540571f6..b34edef1 100644 --- a/socketserver/server/backend_test.go +++ b/socketserver/server/backend_test.go @@ -1,10 +1,11 @@ package server import ( - . "gopkg.in/check.v1" "net/http" "net/url" "testing" + + . "gopkg.in/check.v1" ) func Test(t *testing.T) { TestingT(t) } diff --git a/socketserver/server/commands.go b/socketserver/server/commands.go index e65b3e0c..ffe41293 100644 --- a/socketserver/server/commands.go +++ b/socketserver/server/commands.go @@ -4,13 +4,14 @@ import ( "encoding/json" "errors" "fmt" - "github.com/gorilla/websocket" - "github.com/satori/go.uuid" "log" "net/url" "strconv" "sync" "time" + + "github.com/gorilla/websocket" + "github.com/satori/go.uuid" ) // Command is a string indicating which RPC is requested. diff --git a/socketserver/server/handlecore_test.go b/socketserver/server/handlecore_test.go index c6444c08..8ecf848b 100644 --- a/socketserver/server/handlecore_test.go +++ b/socketserver/server/handlecore_test.go @@ -2,8 +2,9 @@ package server import ( "fmt" - "github.com/gorilla/websocket" "testing" + + "github.com/gorilla/websocket" ) func ExampleUnmarshalClientMessage() { diff --git a/socketserver/server/irc.go b/socketserver/server/irc.go index fe5bf9ff..6ec1f7f9 100644 --- a/socketserver/server/irc.go +++ b/socketserver/server/irc.go @@ -4,11 +4,12 @@ import ( "bytes" "crypto/rand" "encoding/base64" - irc "github.com/fluffle/goirc/client" "log" "strings" "sync" "time" + + irc "github.com/fluffle/goirc/client" ) type AuthCallback func(client *ClientInfo, successful bool) diff --git a/socketserver/server/subscriptions_test.go b/socketserver/server/subscriptions_test.go index 132dda74..9450d609 100644 --- a/socketserver/server/subscriptions_test.go +++ b/socketserver/server/subscriptions_test.go @@ -2,8 +2,6 @@ package server import ( "fmt" - "github.com/gorilla/websocket" - "github.com/satori/go.uuid" "net/http" "net/http/httptest" "net/url" @@ -12,6 +10,9 @@ import ( "syscall" "testing" "time" + + "github.com/gorilla/websocket" + "github.com/satori/go.uuid" ) const TestOrigin = "http://www.twitch.tv" diff --git a/socketserver/server/testinfra_test.go b/socketserver/server/testinfra_test.go index bc7c5e0b..998ccffd 100644 --- a/socketserver/server/testinfra_test.go +++ b/socketserver/server/testinfra_test.go @@ -3,16 +3,17 @@ package server import ( "encoding/json" "fmt" - "github.com/gorilla/websocket" "io/ioutil" "net/http" "net/http/httptest" "net/url" "os" + "strconv" "sync" "testing" "time" - "strconv" + + "github.com/gorilla/websocket" ) const ( diff --git a/socketserver/server/types.go b/socketserver/server/types.go index 3bbca724..44afc158 100644 --- a/socketserver/server/types.go +++ b/socketserver/server/types.go @@ -3,19 +3,19 @@ package server import ( "encoding/json" "fmt" - "github.com/satori/go.uuid" "net" "sync" - "time" + + "github.com/satori/go.uuid" ) const NegativeOne = ^uint64(0) type ConfigFile struct { // Numeric server id known to the backend - ServerID int + ServerID int // Address to bind the HTTP server to on startup. - ListenAddr string + ListenAddr string // Address to bind the TLS server to on startup. SSLListenAddr string // URL to the backend server @@ -24,15 +24,15 @@ type ConfigFile struct { // Minimum memory to accept a new connection MinMemoryKBytes uint64 // Maximum # of clients that can be connected. 0 to disable. - MaxClientCount uint64 + MaxClientCount uint64 // SSL/TLS // Enable the use of SSL. - UseSSL bool + UseSSL bool // Path to certificate file. SSLCertificateFile string // Path to key file. - SSLKeyFile string + SSLKeyFile string UseESLogStashing bool ESServer string diff --git a/socketserver/server/usercount.go b/socketserver/server/usercount.go index 5390a3e8..0bbb7940 100644 --- a/socketserver/server/usercount.go +++ b/socketserver/server/usercount.go @@ -12,9 +12,10 @@ import ( "os" "time" + "io" + "github.com/clarkduvall/hyperloglog" "github.com/satori/go.uuid" - "io" ) // UuidHash implements a hash for uuid.UUID by XORing the random bits. diff --git a/socketserver/server/usercount_test.go b/socketserver/server/usercount_test.go index 6c5a8d2f..2cf608a2 100644 --- a/socketserver/server/usercount_test.go +++ b/socketserver/server/usercount_test.go @@ -1,12 +1,13 @@ package server import ( - "github.com/satori/go.uuid" "net/http/httptest" "net/url" "os" "testing" "time" + + "github.com/satori/go.uuid" ) func TestUniqueConnections(t *testing.T) { diff --git a/socketserver/server/utils.go b/socketserver/server/utils.go index d30ec2a0..1c895e6b 100644 --- a/socketserver/server/utils.go +++ b/socketserver/server/utils.go @@ -5,10 +5,11 @@ import ( "crypto/rand" "encoding/base64" "errors" - "golang.org/x/crypto/nacl/box" "net/url" "strconv" "strings" + + "golang.org/x/crypto/nacl/box" ) func FillCryptoRandom(buf []byte) error {