diff --git a/winsize_linux.go b/winsize_linux.go index 462598a..bf6f3d3 100644 --- a/winsize_linux.go +++ b/winsize_linux.go @@ -5,15 +5,14 @@ import ( "unsafe" ) -type winsize struct { - Row uint16 - Col uint16 - Xpixel uint16 - Ypixel uint16 -} - func init() { - ws := &winsize{} + ws := &struct { + row uint16 + col uint16 + xpixel uint16 + ypixel uint16 + }{} + retCode, _, errno := syscall.Syscall(syscall.SYS_IOCTL, uintptr(syscall.Stdin), uintptr(syscall.TIOCGWINSZ), @@ -23,5 +22,5 @@ func init() { panic(errno) } - Width = int(ws.Col) - 2 + Width = int(ws.col) - 2 }