@@ -62,7 +62,7 @@ func EnsureCredentials(ctx context.Context, conf *config.Config, nodeUUID, nodeN
6262 {
6363 c , cancel := context .WithTimeout (ctx , 10 * time .Second )
6464 defer cancel ()
65- if err : = db .QueryRowContext (
65+ if err = db .QueryRowContext (
6666 c ,
6767 "SELECT COUNT(*) FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = ?" ,
6868 dbName ,
@@ -78,7 +78,7 @@ func EnsureCredentials(ctx context.Context, conf *config.Config, nodeUUID, nodeN
7878 return out , created , err
7979 }
8080 createDB := "CREATE DATABASE IF NOT EXISTS " + qDB + " CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"
81- if err : = execTimeout (ctx , db , 15 * time .Second , createDB ); err != nil {
81+ if err = execTimeout (ctx , db , 15 * time .Second , createDB ); err != nil {
8282 return out , created , err
8383 }
8484
@@ -93,14 +93,14 @@ func EnsureCredentials(ctx context.Context, conf *config.Config, nodeUUID, nodeN
9393 }
9494
9595 createUser := "CREATE USER IF NOT EXISTS " + acc + " IDENTIFIED BY " + pass
96- if err : = execTimeout (ctx , db , 10 * time .Second , createUser ); err != nil {
96+ if err = execTimeout (ctx , db , 10 * time .Second , createUser ); err != nil {
9797 return out , created , err
9898 }
9999
100100 // 4) Rotate or set password explicitly on first creation.
101101 if rotate || created {
102102 alterUser := "ALTER USER " + acc + " IDENTIFIED BY " + pass
103- if err : = execTimeout (ctx , db , 10 * time .Second , alterUser ); err != nil {
103+ if err = execTimeout (ctx , db , 10 * time .Second , alterUser ); err != nil {
104104 return out , created , err
105105 }
106106 out .Password = dbPass
@@ -109,12 +109,12 @@ func EnsureCredentials(ctx context.Context, conf *config.Config, nodeUUID, nodeN
109109
110110 // 5) Grant privileges on schema.
111111 grant := "GRANT ALL PRIVILEGES ON " + qDB + ".* TO " + acc
112- if err : = execTimeout (ctx , db , 10 * time .Second , grant ); err != nil {
112+ if err = execTimeout (ctx , db , 10 * time .Second , grant ); err != nil {
113113 return out , created , err
114114 }
115115
116116 // 6) Optional on modern MariaDB/MySQL; harmless if included.
117- if err : = execTimeout (ctx , db , 5 * time .Second , "FLUSH PRIVILEGES" ); err != nil {
117+ if err = execTimeout (ctx , db , 5 * time .Second , "FLUSH PRIVILEGES" ); err != nil {
118118 return out , created , err
119119 }
120120
0 commit comments