refact: refactored to use islazy and updated deps

This commit is contained in:
evilsocket 2018-10-10 19:00:25 +02:00
parent a2b3ee79fb
commit d070445225
238 changed files with 12662 additions and 1586 deletions

20
vendor/github.com/mdlayher/raw/timeval.go generated vendored Normal file
View file

@ -0,0 +1,20 @@
// +build !darwin,!arm,!windows,!mipsle,!mips
package raw
import (
"syscall"
"time"
)
// newTimeval transforms a duration into a syscall.Timeval struct.
// An error is returned in case of zero time value.
func newTimeval(timeout time.Duration) (*syscall.Timeval, error) {
if timeout < time.Microsecond {
return nil, &timeoutError{}
}
return &syscall.Timeval{
Sec: int64(timeout / time.Second),
Usec: int64(timeout % time.Second / time.Microsecond),
}, nil
}