fix: rename Db
to DB
This commit is contained in:
parent
212cf19d05
commit
28e0522993
6
dsn.go
6
dsn.go
@ -10,14 +10,14 @@ type DSN struct {
|
||||
Port int
|
||||
User string
|
||||
Pass string
|
||||
Db string
|
||||
DB string
|
||||
Options map[string]string
|
||||
}
|
||||
|
||||
func (d DSN) String() string {
|
||||
dsn := d.User + ":" + d.Pass + "@tcp(" + d.Host + ":" + strconv.Itoa(d.Port) + ")/" + d.Db
|
||||
dsn := d.User + ":" + d.Pass + "@tcp(" + d.Host + ":" + strconv.Itoa(d.Port) + ")/" + d.DB
|
||||
|
||||
if d.Options != nil {
|
||||
if d.Options != nil && len(d.Options) > 0 {
|
||||
value := url.Values{}
|
||||
|
||||
for k, v := range d.Options {
|
||||
|
@ -8,7 +8,7 @@ func TestDsn(t *testing.T) {
|
||||
Port: 3306,
|
||||
User: "root",
|
||||
Pass: "password",
|
||||
Db: "gorm",
|
||||
DB: "gorm",
|
||||
}
|
||||
|
||||
t.Run("dsn string", func(t *testing.T) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user