anvie / port-scanner

Simple port scanner library for Go
105 stars 20 forks source link

Errors compiling PortScanner #2

Open rhinesj opened 8 years ago

rhinesj commented 8 years ago

It looks like a timeout field was added and the rest of the code wasn't updated to account for it.

go version go1.5.3 darwin/amd64

github.com/anvie/port-scanner

../../../../anvie/port-scanner/PortScanner.go:27: too few values in struct initializer ../../../../anvie/port-scanner/PortScanner.go:50: cannot use h.timeout (type int) as type time.Duration in argument to net.DialTimeout ../../../../anvie/port-scanner/PortScanner.go:82: cannot use h.timeout (type int) as type time.Duration in argument to net.DialTimeout ../../../../anvie/port-scanner/PortScanner.go:87: cannot use conn (type net.Conn) as type *net.TCPConn in return argument: need type assertion

edib commented 8 years ago

I am facing same problem $ go version go version go1.6.1 linux/amd64

github.com/anvie/port-scanner

src/github.com/anvie/port-scanner/PortScanner.go:27: too few values in struct initializer src/github.com/anvie/port-scanner/PortScanner.go:50: cannot use h.timeout (type int) as type time.Duration in argument to net.DialTimeout src/github.com/anvie/port-scanner/PortScanner.go:82: cannot use h.timeout (type int) as type time.Duration in argument to net.DialTimeout src/github.com/anvie/port-scanner/PortScanner.go:87: cannot use conn (type net.Conn) as type *net.TCPConn in return argument: need type assertion

rhinesj commented 8 years ago

I went ahead and forked and fixed it. I think I submitted a PR? I don't remember.

https://github.com/rhinesj/port-scanner

On Tue, Jun 14, 2016 at 9:30 AM, ibrahim edib kokdemir < notifications@github.com> wrote:

I am facing same problem $ go version go version go1.6.1 linux/amd64 github.com/anvie/port-scanner

src/github.com/anvie/port-scanner/PortScanner.go:27: too few values in struct initializer src/github.com/anvie/port-scanner/PortScanner.go:50: cannot use h.timeout (type int) as type time.Duration in argument to net.DialTimeout src/github.com/anvie/port-scanner/PortScanner.go:82: cannot use h.timeout (type int) as type time.Duration in argument to net.DialTimeout src/github.com/anvie/port-scanner/PortScanner.go:87: cannot use conn (type net.Conn) as type *net.TCPConn in return argument: need type assertion

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/anvie/port-scanner/issues/2#issuecomment-225899537, or mute the thread https://github.com/notifications/unsubscribe/APzXGw4rWp138EEgEEEP6ReMPLTmKhORks5qLrsDgaJpZM4HSjSd .

anvie commented 8 years ago

Hi @rhinesj let me check, sorry for long time not checked it up.