Add golint to test (#255)
* Add a new lint rule to the Makefile Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Fix linter errors Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com> * Allow replacing the default apt mirror Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
This commit is contained in:
parent
4176ba7b52
commit
5624732128
38 changed files with 297 additions and 151 deletions
|
@ -6,14 +6,17 @@ import (
|
|||
"syscall"
|
||||
)
|
||||
|
||||
// EpollCreate1 directly calls syscall.EpollCreate1
|
||||
func EpollCreate1(flag int) (int, error) {
|
||||
return syscall.EpollCreate1(flag)
|
||||
}
|
||||
|
||||
// EpollCtl directly calls syscall.EpollCtl
|
||||
func EpollCtl(epfd int, op int, fd int, event *syscall.EpollEvent) error {
|
||||
return syscall.EpollCtl(epfd, op, fd, event)
|
||||
}
|
||||
|
||||
// EpollWait directly calls syscall.EpollWait
|
||||
func EpollWait(epfd int, events []syscall.EpollEvent, msec int) (int, error) {
|
||||
return syscall.EpollWait(epfd, events, msec)
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ import (
|
|||
"unsafe"
|
||||
)
|
||||
|
||||
// EpollCreate1 calls a C implementation
|
||||
func EpollCreate1(flag int) (int, error) {
|
||||
fd := int(C.EpollCreate1(C.int(flag)))
|
||||
if fd < 0 {
|
||||
|
@ -48,6 +49,7 @@ func EpollCreate1(flag int) (int, error) {
|
|||
return fd, nil
|
||||
}
|
||||
|
||||
// EpollCtl calls a C implementation
|
||||
func EpollCtl(epfd int, op int, fd int, event *syscall.EpollEvent) error {
|
||||
errno := C.EpollCtl(C.int(epfd), C.int(syscall.EPOLL_CTL_ADD), C.int(fd), C.int(event.Events), C.int(event.Fd))
|
||||
if errno < 0 {
|
||||
|
@ -56,6 +58,7 @@ func EpollCtl(epfd int, op int, fd int, event *syscall.EpollEvent) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// EpollWait calls a C implementation
|
||||
func EpollWait(epfd int, events []syscall.EpollEvent, msec int) (int, error) {
|
||||
var c_events [128]C.struct_event_t
|
||||
n := int(C.run_epoll_wait(C.int(epfd), (*C.struct_event_t)(unsafe.Pointer(&c_events))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue