pkg/util/portforward.go
Method PortForwarder.handleConnection
has 67 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (pf *PortForwarder) handleConnection(conn net.Conn, port ForwardedPort) {
defer conn.Close()
if pf.out != nil {
fmt.Fprintf(pf.out, "Handling connection for %d\n", port.Local)
Function NewOnAddresses
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func NewOnAddresses(dialer httpstream.Dialer, addresses []string, ports []string, stopChan <-chan struct{}, readyChan chan struct{}, out, errOut io.Writer) (*PortForwarder, error) {
Function NewOnAddresses
has 5 return statements (exceeds 4 allowed). Open
Open
func NewOnAddresses(dialer httpstream.Dialer, addresses []string, ports []string, stopChan <-chan struct{}, readyChan chan struct{}, out, errOut io.Writer) (*PortForwarder, error) {
if len(addresses) == 0 {
return nil, errors.New("you must specify at least 1 address")
}
parsedAddresses, err := parseAddresses(addresses)
Function parsePorts
has 5 return statements (exceeds 4 allowed). Open
Open
func parsePorts(ports []string) ([]ForwardedPort, error) {
var forwards []ForwardedPort
for _, portString := range ports {
parts := strings.Split(portString, ":")
var localString, remoteString string