chore: update linter.

This commit is contained in:
Ludovic Fernandez 2020-07-07 14:42:03 +02:00 committed by GitHub
parent d698eba1e7
commit a20e90aa17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
91 changed files with 646 additions and 459 deletions

View file

@ -11,7 +11,7 @@ import (
const cookieNameLength = 6
// GetName of a cookie.
func GetName(cookieName string, backendName string) string {
func GetName(cookieName, backendName string) string {
if len(cookieName) != 0 {
return sanitizeName(cookieName)
}

View file

@ -40,6 +40,6 @@ func GetQualifiedName(ctx context.Context, elementName string) string {
}
// MakeQualifiedName Creates a qualified name for an element.
func MakeQualifiedName(providerName string, elementName string) string {
func MakeQualifiedName(providerName, elementName string) string {
return elementName + "@" + providerName
}

View file

@ -90,7 +90,7 @@ type nameAndConfig struct {
TLSConfig *tls.Config
}
func (m *Manager) buildEntryPointHandler(ctx context.Context, configs map[string]*runtime.TCPRouterInfo, configsHTTP map[string]*runtime.RouterInfo, handlerHTTP http.Handler, handlerHTTPS http.Handler) (*tcp.Router, error) {
func (m *Manager) buildEntryPointHandler(ctx context.Context, configs map[string]*runtime.TCPRouterInfo, configsHTTP map[string]*runtime.RouterInfo, handlerHTTP, handlerHTTPS http.Handler) (*tcp.Router, error) {
router := &tcp.Router{}
router.HTTPHandler(handlerHTTP)

View file

@ -379,7 +379,6 @@ func buildProxyProtocolListener(ctx context.Context, entryPoint *static.EntryPoi
func buildListener(ctx context.Context, entryPoint *static.EntryPoint) (net.Listener, error) {
listener, err := net.Listen("tcp", entryPoint.GetAddress())
if err != nil {
return nil, fmt.Errorf("error opening listener: %w", err)
}

View file

@ -27,7 +27,7 @@ type InternalHandlers struct {
}
// NewInternalHandlers creates a new InternalHandlers.
func NewInternalHandlers(api func(configuration *runtime.Configuration) http.Handler, configuration *runtime.Configuration, rest http.Handler, metricsHandler http.Handler, pingHandler http.Handler, dashboard http.Handler, next serviceManager) *InternalHandlers {
func NewInternalHandlers(api func(configuration *runtime.Configuration) http.Handler, configuration *runtime.Configuration, rest, metricsHandler, pingHandler, dashboard http.Handler, next serviceManager) *InternalHandlers {
var apiHandler http.Handler
if api != nil {
apiHandler = api(configuration)

View file

@ -63,7 +63,7 @@ func TestWebSocketPingPong(t *testing.T) {
require.NoError(t, err)
var upgrader = gorillawebsocket.Upgrader{
upgrader := gorillawebsocket.Upgrader{
HandshakeTimeout: 10 * time.Second,
CheckOrigin: func(*http.Request) bool {
return true
@ -670,7 +670,7 @@ func (w *websocketRequest) send() (string, error) {
if _, err := conn.Write([]byte(w.Data)); err != nil {
return "", err
}
var msg = make([]byte, 512)
msg := make([]byte, 512)
var n int
n, err = conn.Read(msg)
if err != nil {