if no arguments, return error at once
This commit is contained in:
parent
ab703afe97
commit
0d54677e13
4
main.go
4
main.go
@ -44,7 +44,8 @@ func Open(dialect string, args ...interface{}) (*DB, error) {
|
||||
|
||||
if len(args) == 0 {
|
||||
err = errors.New("invalid database source")
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
var source string
|
||||
var dbSQL sqlCommon
|
||||
|
||||
@ -79,7 +80,6 @@ func Open(dialect string, args ...interface{}) (*DB, error) {
|
||||
db.DB().Close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return &db, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user