Anonymous struct is sufficient
This commit is contained in:
parent
89cf49af58
commit
b0b2d09871
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user