@@ -10,6 +10,7 @@ import (
1010 "bytes"
1111 "context"
1212 "encoding/base64"
13+ "errors"
1314 "fmt"
1415 "net/http"
1516 "net/url"
@@ -58,18 +59,18 @@ func NewKerberosAdapter(cnf KerberosConfig, log log.StructuredLogger) (*Kerberos
5859 // technically this should not happen as adapter should not be initialized without
5960 // proper config present, but better safe than sorry
6061 if cnf .CfgFilePath == "" {
61- return nil , fmt . Errorf ("kerberos config file (krb5.conf) not specified" )
62+ return nil , errors . New ("kerberos config file (krb5.conf) not specified" )
6263 }
6364
6465 if cnf .KeyTabFilePath == "" {
65- return nil , fmt . Errorf ("kerberos keytab file not specified" )
66+ return nil , errors . New ("kerberos keytab file not specified" )
6667 }
6768
6869 if cnf .UserName == "" {
69- return nil , fmt . Errorf ("kerberos username not specified" )
70+ return nil , errors . New ("kerberos username not specified" )
7071 }
7172 if cnf .UserRealm == "" {
72- return nil , fmt . Errorf ("kerberos user realm not specified" )
73+ return nil , errors . New ("kerberos user realm not specified" )
7374 }
7475
7576 krb5Config , err := config .Load (cnf .CfgFilePath )
@@ -112,14 +113,13 @@ func (a *KerberosClient) ConnectToKDC() error {
112113
113114 // We need to print directly to stdout as it contains a nested structured text.
114115 // Does not really matter as diagnostics mode should be used on local console only.
115- fmt .Printf ("%s" , buf .String ())
116+ fmt .Printf ("%s" , buf .String ()) //nolint
116117
117118 if err != nil {
118119 return fmt .Errorf ("kerberos configuration potential problems: %w" , err )
119120 }
120121
121- return fmt .Errorf ("no kerberos configuration problems found. Exiting process" )
122-
122+ return errors .New ("no kerberos configuration problems found. Exiting process" )
123123 }
124124
125125 return nil
0 commit comments