Skip to content

Commit 14d9dfa

Browse files
committed
make getBackendDBUri private
1 parent f8eb180 commit 14d9dfa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/group/mysql.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func NewMySQLBackend(throttler *throttle.Throttler) (*MySQLBackend, error) {
7777
if config.Settings().BackendMySQLHost == "" {
7878
return nil, nil
7979
}
80-
dbUri := GetBackendDBUri()
80+
dbUri := getBackendDBUri()
8181
db, _, err := sqlutils.GetDB(dbUri)
8282
if err != nil {
8383
return nil, err
@@ -107,7 +107,7 @@ func NewMySQLBackend(throttler *throttle.Throttler) (*MySQLBackend, error) {
107107
}
108108

109109
// helper function to get the DB URI
110-
func GetBackendDBUri() string {
110+
func getBackendDBUri() string {
111111
dsnCharsetCollation := "charset=utf8mb4,utf8,latin1"
112112
if config.Settings().BackendMySQLCollation != "" {
113113
// Set collation instead of charset, if BackendMySQLCollation is specified

pkg/group/mysql_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ func TestGetBackendDBUri(t *testing.T) {
2525
config.Settings().BackendMySQLSchema = "test_database"
2626

2727
// test default (charset)
28-
dbUri := GetBackendDBUri()
28+
dbUri := getBackendDBUri()
2929
test.S(t).ExpectEquals(dbUri, "gromit:penguin@tcp(myhost:3306)/test_database?interpolateParams=true&charset=utf8mb4,utf8,latin1&timeout=500ms")
3030

3131
// test setting collation
3232
config.Settings().BackendMySQLCollation = "utf8mb4_unicode_ci"
33-
dbUri = GetBackendDBUri()
33+
dbUri = getBackendDBUri()
3434
test.S(t).ExpectEquals(dbUri, "gromit:penguin@tcp(myhost:3306)/test_database?interpolateParams=true&collation=utf8mb4_unicode_ci&timeout=500ms")
3535
}

0 commit comments

Comments
 (0)