goadb/nil_safe_dialer.go

16 lines
254 B
Go
Raw Normal View History

package goadb
import "github.com/zach-klippenstein/goadb/wire"
type nilSafeDialer struct {
wire.Dialer
}
func (d nilSafeDialer) Dial() (*wire.Conn, error) {
if d.Dialer == nil {
2015-04-29 17:23:51 +00:00
d.Dialer = wire.NewDialer("", AdbPort)
}
return d.Dialer.Dial()
}