@@ -421,14 +421,14 @@ func setupGlobalMiddleware(handler http.Handler) http.Handler {
421421func authenticateUser (user string , pass string , cli * client_native.HAProxyClient ) (interface {}, error ) {
422422 data , err := cli .Configuration .Parser .Get (parser .UserList , haproxyOptions .Userlist , "user" )
423423 if err != nil {
424- return nil , fmt .Errorf ("Error reading userlist %v userlist in conf: %s" , haproxyOptions .Userlist , err .Error ())
424+ return nil , fmt .Errorf ("error reading userlist %v userlist in conf: %s" , haproxyOptions .Userlist , err .Error ())
425425 }
426426 users , ok := data .([]types.User )
427427 if ! ok {
428- return nil , fmt .Errorf ("Error reading users from %v userlist in conf" , haproxyOptions .Userlist )
428+ return nil , fmt .Errorf ("error reading users from %v userlist in conf" , haproxyOptions .Userlist )
429429 }
430430 if len (users ) == 0 {
431- return nil , fmt .Errorf ("No users configured in %v userlist in conf" , haproxyOptions .Userlist )
431+ return nil , fmt .Errorf ("no users configured in %v userlist in conf" , haproxyOptions .Userlist )
432432 }
433433
434434 for _ , u := range users {
@@ -467,7 +467,7 @@ func configureLogging() {
467467 if err := os .MkdirAll (dir , os .ModePerm ); err != nil {
468468 log .Warning ("Error opening log file, no logging implemented: " + err .Error ())
469469 }
470-
470+ //nolint:govet
471471 logFile , err := os .OpenFile (loggingOptions .LogFile , os .O_APPEND | os .O_CREATE | os .O_RDWR , 0666 )
472472 if err != nil {
473473 log .Warning ("Error opening log file, no logging implemented: " + err .Error ())
@@ -555,7 +555,7 @@ func configureConfigurationClient() (*configuration.Client, error) {
555555 }
556556 err := confClient .Init (confParams )
557557 if err != nil {
558- return nil , fmt .Errorf ("Error setting up configuration client: %s" , err .Error ())
558+ return nil , fmt .Errorf ("error setting up configuration client: %s" , err .Error ())
559559 }
560560 return confClient , nil
561561}
@@ -602,6 +602,7 @@ func configureRuntimeClient(confClient *configuration.Client) *runtime_api.Clien
602602 // else try to find process specific sockets and set them up
603603 sockets := make (map [int ]string )
604604 for _ , r := range runtimeAPIs {
605+ //nolint:govet
605606 if misc .IsUnixSocketAddr (* r .Address ) && r .Process != "" {
606607 process , err := strconv .ParseInt (r .Process , 10 , 64 )
607608 if err == nil {
@@ -614,15 +615,15 @@ func configureRuntimeClient(confClient *configuration.Client) *runtime_api.Clien
614615 log .Warning ("Runtime API not configured, found multiple processes and no stats sockets bound to them." )
615616 return nil
616617 // use only found process specific sockets issue a warning if not all processes have a socket configured
617- } else {
618- if len (sockets ) < int (globalConf .Nbproc ) {
619- log .Warning ("Runtime API not configured properly, there are more processes then configured sockets" )
620- }
621- if err = runtimeClient .InitWithSockets (sockets ); err == nil {
622- return runtimeClient
623- }
624- log .Warningf ("Error setting up runtime client with sockets: %s : %s" , sockets , err .Error ())
625618 }
619+ if len (sockets ) < int (globalConf .Nbproc ) {
620+ log .Warning ("Runtime API not configured properly, there are more processes then configured sockets" )
621+ }
622+ if err = runtimeClient .InitWithSockets (sockets ); err == nil {
623+ return runtimeClient
624+ }
625+ log .Warningf ("Error setting up runtime client with sockets: %v : %s" , sockets , err .Error ())
626+
626627 }
627628 if err != nil {
628629 log .Warning ("Runtime API not configured, not using it: " + err .Error ())
@@ -636,6 +637,7 @@ func configureRuntimeClient(confClient *configuration.Client) *runtime_api.Clien
636637}
637638
638639func handleSignals (sigs chan os.Signal , client * client_native.HAProxyClient ) {
640+ //nolint:gosimple
639641 for {
640642 select {
641643 case sig := <- sigs :
0 commit comments