From b0b2d09871ef94f623bddb38f0bb3dbb10c0aa95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Sat, 16 May 2020 11:12:44 +0200 Subject: [PATCH] Anonymous struct is sufficient --- winsize_linux.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) 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 }