(t *testing.T, values map[string]string)
| 9 | ) |
| 10 | |
| 11 | func setDBEnv(t *testing.T, values map[string]string) { |
| 12 | t.Helper() |
| 13 | |
| 14 | keys := []string{ |
| 15 | "DB_USER", |
| 16 | "DB_PASSWORD", |
| 17 | "DB_HOST", |
| 18 | "DB_PORT", |
| 19 | "DB_NAME", |
| 20 | "DB_CHARSET", |
| 21 | "DB_PARSE_TIME", |
| 22 | "DB_LOC", |
| 23 | } |
| 24 | |
| 25 | for _, key := range keys { |
| 26 | t.Setenv(key, values[key]) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | func parseConfig(t *testing.T, dsn string) *mysql.Config { |
| 31 | t.Helper() |
no outgoing calls
no test coverage detected