Fix lint errors

This commit is contained in:
9seconds
2018-07-09 16:11:05 +03:00
parent fb00cd1121
commit 29b5130c95
32 changed files with 207 additions and 55 deletions
+7 -2
View File
@@ -21,8 +21,8 @@ var (
type connectionData struct {
connectionType mtproto.ConnectionType
addr *net.TCPAddr
connected bool
addr *net.TCPAddr
}
type trafficData struct {
@@ -40,7 +40,7 @@ func crashManager() {
}
}
func connectionManager() {
func connectionManager() { // nolint: gocyclo
for event := range connectionsChan {
instance.mutex.RLock()
@@ -111,10 +111,12 @@ func trafficManager() {
}
}
// NewCrash indicates new crash.
func NewCrash() {
crashesChan <- struct{}{}
}
// ClientConnected indicates that new client was connected.
func ClientConnected(connectionType mtproto.ConnectionType, addr *net.TCPAddr) {
connectionsChan <- &connectionData{
connectionType: connectionType,
@@ -123,6 +125,7 @@ func ClientConnected(connectionType mtproto.ConnectionType, addr *net.TCPAddr) {
}
}
// ClientDisconnected indicates that client was disconnected.
func ClientDisconnected(connectionType mtproto.ConnectionType, addr *net.TCPAddr) {
connectionsChan <- &connectionData{
connectionType: connectionType,
@@ -131,6 +134,7 @@ func ClientDisconnected(connectionType mtproto.ConnectionType, addr *net.TCPAddr
}
}
// IngressTraffic accounts new ingress traffic.
func IngressTraffic(traffic int) {
trafficChan <- &trafficData{
traffic: traffic,
@@ -138,6 +142,7 @@ func IngressTraffic(traffic int) {
}
}
// EgressTraffic accounts new ingress traffic.
func EgressTraffic(traffic int) {
trafficChan <- &trafficData{
traffic: traffic,
+2 -1
View File
@@ -13,6 +13,7 @@ import (
var instance *stats
// Start starts new statisitcs server.
func Start(conf *config.Config) {
log := zap.S().Named("stats")
@@ -40,7 +41,7 @@ func Start(conf *config.Config) {
}
interm := map[string]interface{}{}
json.Unmarshal(first, &interm)
json.Unmarshal(first, &interm) // nolint: errcheck
encoder := json.NewEncoder(w)
encoder.SetEscapeHTML(false)