mirror of https://github.com/perkeep/perkeep.git
Fix mymysql for Go 1.1; see https://code.google.com/p/go/issues/detail?id=4476
Change-Id: I6b5d66b68715f7d71ce665dbf90dfc0d4eefab5a
This commit is contained in:
parent
ed67d8926a
commit
43e240f0f6
|
@ -42,7 +42,8 @@ var _ index.IndexStorage = (*myIndexStorage)(nil)
|
|||
// This exists mostly for testing and does not initialize the schema.
|
||||
func NewStorage(host, user, password, dbname string) (index.IndexStorage, error) {
|
||||
// TODO(bradfitz): host is ignored; how to plumb it through with mymysql?
|
||||
db, err := sql.Open("mymysql", dbname+"/"+user+"/"+password)
|
||||
dsn := dbname+"/"+user+"/"+password
|
||||
db, err := sql.Open("mymysql", dsn)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -104,12 +104,12 @@ func (my *Conn) connect() (err error) {
|
|||
case "tcp", "tcp4", "tcp6":
|
||||
var la, ra *net.TCPAddr
|
||||
if my.laddr != "" {
|
||||
if la, err = net.ResolveTCPAddr("", my.laddr); err != nil {
|
||||
if la, err = net.ResolveTCPAddr("tcp", my.laddr); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
if my.raddr != "" {
|
||||
if ra, err = net.ResolveTCPAddr("", my.raddr); err != nil {
|
||||
if ra, err = net.ResolveTCPAddr("tcp", my.raddr); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue