Skip to content

Commit

Permalink
Fixing issues with oracle usernames and passwords
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Shaw committed Mar 7, 2017
1 parent 3e10b4b commit a9f4b29
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions dburl.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,17 +353,16 @@ func oracleProcess(u *URL) (string, string, error) {
dsn := u.Host + u.Path

// build user/pass
var un string
if u.User != nil {
if un := u.User.Username(); len(un) > 0 {
if un = u.User.Username(); len(un) > 0 {
if up, ok := u.User.Password(); ok {
un += ":" + up
un += "/" + up
}
dsn = un + "@" + dsn
}
}

// format
return "ora", dsn, nil
return "ora", un + "@" + dsn, nil
}

// postgresProcess processes a postgres url and protocol.
Expand Down

0 comments on commit a9f4b29

Please sign in to comment.