@@ -62,8 +62,9 @@ func main() {
6262 isInvalidResource := resource != operations .RealmResource && resource != operations .ClientResource &&
6363 resource != operations .UserResource && resource != operations .ServerSettings
6464 if isInvalidResource {
65+ msg := sf .Format ("Non supported resource \" {0}\" " , resource )
6566 //nolint:govet
66- log .Fatalf (sf . Format ( "Non supported resource \" {0} \" " , resource ) )
67+ log .Fatalf (msg )
6768 }
6869 }
6970 if (resource == operations .ClientResource ) || (resource == operations .UserResource ) {
@@ -222,12 +223,14 @@ func main() {
222223 case operations .RealmResource :
223224 var newRealm data.Realm
224225 if parseErr := json .Unmarshal (value , & newRealm ); parseErr != nil {
226+ parseErrMsg := sf .Format ("json.Unmarshal failed: {0}" , parseErr .Error ())
225227 //nolint:govet
226- log .Fatalf (sf . Format ( "json.Unmarshal failed: {0}" , parseErr . Error ()) )
228+ log .Fatalf (parseErrMsg )
227229 }
228230 if updateErr := manager .UpdateRealm (resourceId , newRealm ); updateErr != nil {
231+ updateErrMsg := sf .Format ("UpdateRealm failed: {0}" , updateErr )
229232 //nolint:govet
230- log .Fatalf (sf . Format ( "UpdateRealm failed: {0}" , updateErr ) )
233+ log .Fatalf (updateErrMsg )
231234 }
232235 fmt .Println (sf .Format ("Realm: \" {0}\" successfully updated" , newRealm .Name ))
233236 case operations .UserFederationConfigResource :
@@ -238,11 +241,13 @@ func main() {
238241 if err := manager .UpdateUserFederationConfig (params , resourceId , userFederationServiceConfig ); err != nil {
239242 log .Fatalf ("UpdateUserFederationConfig failed: %s" , err )
240243 }
241- fmt .Println (sf .Format ("User federation service config: \" {0}\" successfully updated" , userFederationServiceConfig .Name , params ))
244+ fmt .Println (sf .Format ("User federation service config: \" {0}\" successfully updated" ,
245+ userFederationServiceConfig .Name , params ))
242246 case operations .ServerSettings :
243247 var security config.GlobalSecurityConfig
244248 if parseErr := json .Unmarshal (value , & security ); parseErr != nil {
245- log .Fatalf (sf .Format ("json.Unmarshal failed: {0}" , parseErr ))
249+ msg := sf .Format ("json.Unmarshal failed: {0}" , parseErr )
250+ log .Fatalf (msg )
246251 }
247252 serverSettings , readErr := manager .GetServerSettings ()
248253 var encoder * encoding.PasswordJsonEncoder
@@ -261,7 +266,8 @@ func main() {
261266 serverSettings .Admin .PasswordHash = encoder .GetB64PasswordHash (serverSettings .Admin .PasswordSalt )
262267
263268 if setErr := manager .SetServerSettings (serverSettings ); setErr != nil {
264- log .Fatalf (sf .Format ("UpdateUserFederationConfig failed: {0}" , setErr ))
269+ msg := sf .Format ("UpdateUserFederationConfig failed: {0}" , setErr )
270+ log .Fatalf (msg )
265271 }
266272 fmt .Println ("Server settings were successfully updated" )
267273 }
@@ -277,7 +283,8 @@ func main() {
277283 if resource == operations .AdminResource {
278284 serverSettings , readErr := manager .GetServerSettings ()
279285 if readErr != nil {
280- log .Fatalf (sf .Format ("There is an error while getting ServerSettings: {0}" , readErr .Error ()))
286+ msg := sf .Format ("There is an error while getting ServerSettings: {0}" , readErr .Error ())
287+ log .Fatalf (msg )
281288 }
282289 encoder := encoding .NewPasswordJsonEncoder (serverSettings .Admin .PasswordSalt )
283290 serverSettings .Admin .PasswordHash = encoder .GetB64PasswordHash (serverSettings .Admin .PasswordSalt )
0 commit comments