Update golangci-lint

This commit is contained in:
9seconds
2020-08-10 14:39:50 +03:00
parent 8ac786581b
commit 7a6695f6c4
47 changed files with 133 additions and 114 deletions
+7 -4
View File
@@ -5,11 +5,10 @@ import (
"net/http"
"strconv"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/9seconds/mtg/config"
"github.com/9seconds/mtg/conntypes"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
type statsPrometheus struct {
@@ -51,10 +50,14 @@ func (s *statsPrometheus) changeConnections(connectionType conntypes.ConnectionT
labels[0] = "abridged"
case conntypes.ConnectionTypeSecure:
labels[0] = "secured"
case conntypes.ConnectionTypeIntermediate:
labels[0] = "intermediate"
case conntypes.ConnectionTypeUnknown:
panic("unknown connection type")
}
if addr.IP.To4() == nil {
labels[1] = "ipv6" // nolint: goconst
labels[1] = "ipv6"
}
s.connections.WithLabelValues(labels[:]...).Add(increment)
+5 -4
View File
@@ -8,11 +8,10 @@ import (
"sync"
"time"
statsd "github.com/smira/go-statsd"
"go.uber.org/zap"
"github.com/9seconds/mtg/config"
"github.com/9seconds/mtg/conntypes"
statsd "github.com/smira/go-statsd"
"go.uber.org/zap"
)
var (
@@ -91,8 +90,10 @@ func (s *statsStatsd) changeConnections(connectionType conntypes.ConnectionType,
tags = append(tags, tagConnectionTypeAbridged)
case conntypes.ConnectionTypeIntermediate:
tags = append(tags, tagConnectionTypeIntermediate)
default:
case conntypes.ConnectionTypeSecure:
tags = append(tags, tagConnectionTypeSecured)
case conntypes.ConnectionTypeUnknown:
panic("Unknown connection type")
}
if addr.IP.To4() == nil {