chore: update linter

This commit is contained in:
Ludovic Fernandez 2022-08-31 08:24:08 +02:00 committed by GitHub
parent 25027d6df8
commit adf82d72ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 74 additions and 67 deletions

View file

@ -106,7 +106,7 @@ func (r *Router) ServeTCP(conn tcp.WriteCloser) {
// we still need to reply with a 404.
}
// FIXME -- Check if ProxyProtocol changes the first bytes of the request
// TODO -- Check if ProxyProtocol changes the first bytes of the request
br := bufio.NewReader(conn)
serverName, tls, peeked, err := clientHelloServerName(br)
if err != nil {
@ -218,7 +218,7 @@ func (r *Router) AddHTTPTLSConfig(sniHost string, config *tls.Config) {
// GetConn creates a connection proxy with a peeked string.
func (r *Router) GetConn(conn tcp.WriteCloser, peeked string) tcp.WriteCloser {
// FIXME should it really be on Router ?
// TODO should it really be on Router ?
conn = &Conn{
Peeked: []byte(peeked),
WriteCloser: conn,

View file

@ -52,11 +52,7 @@ func (m *Manager) BuildHandlers(rootCtx context.Context, entryPoints []string) m
log.FromContext(ctx).Warn("Config has more than one udp router for a given entrypoint.")
}
handlers, err := m.buildEntryPointHandlers(ctx, routers)
if err != nil {
log.FromContext(ctx).Error(err)
continue
}
handlers := m.buildEntryPointHandlers(ctx, routers)
if len(handlers) > 0 {
// As UDP support only one router per entrypoint, we only take the first one.
@ -66,7 +62,7 @@ func (m *Manager) BuildHandlers(rootCtx context.Context, entryPoints []string) m
return entryPointHandlers
}
func (m *Manager) buildEntryPointHandlers(ctx context.Context, configs map[string]*runtime.UDPRouterInfo) ([]udp.Handler, error) {
func (m *Manager) buildEntryPointHandlers(ctx context.Context, configs map[string]*runtime.UDPRouterInfo) []udp.Handler {
var rtNames []string
for routerName := range configs {
rtNames = append(rtNames, routerName)
@ -101,5 +97,5 @@ func (m *Manager) buildEntryPointHandlers(ctx context.Context, configs map[strin
handlers = append(handlers, handler)
}
return handlers, nil
return handlers
}