s/Get(Master|Replica)X/Get\1/g (#29520)
Drop the legacy `X` suffix from `GetMasterX` and `GetReplicaX`. The presence of the suffix suggests there's a `non-X` version: but in fact we migrated these away a long time ago, so remove the cognitive overhead. As an aside, this additionally helps avoid trip up LLMs that interpret this as "something to fix".
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8b86e1276e
Коммит
5369f8b36b
@@ -36,7 +36,7 @@ func truncateTable(t *testing.T, table string) {
|
||||
|
||||
switch *sqlSetting.DriverName {
|
||||
case model.DatabaseDriverMysql:
|
||||
_, err := sqlStore.GetMasterX().Exec(fmt.Sprintf("TRUNCATE TABLE %s", table))
|
||||
_, err := sqlStore.GetMaster().Exec(fmt.Sprintf("TRUNCATE TABLE %s", table))
|
||||
if err != nil {
|
||||
if driverErr, ok := err.(*mysql.MySQLError); ok {
|
||||
// Ignore if the Configurations table does not exist.
|
||||
@@ -48,7 +48,7 @@ func truncateTable(t *testing.T, table string) {
|
||||
require.NoError(t, err)
|
||||
|
||||
case model.DatabaseDriverPostgres:
|
||||
_, err := sqlStore.GetMasterX().Exec(fmt.Sprintf("TRUNCATE TABLE %s", table))
|
||||
_, err := sqlStore.GetMaster().Exec(fmt.Sprintf("TRUNCATE TABLE %s", table))
|
||||
if err != nil {
|
||||
if driverErr, ok := err.(*pq.Error); ok {
|
||||
// Ignore if the Configurations table does not exist.
|
||||
|
||||
Ссылка в новой задаче
Block a user