From 47e6c8196c5ed1d8d0144f106f03ce0977864875 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 26 Nov 2018 10:41:34 +0100 Subject: [PATCH] ssh/terminal: use "reports whether" in IsTerminal doc Go documentation style for boolean funcs is to say: // Foo reports whether ... func Foo() bool (rather than "returns true if") Change-Id: I6972d123ba99bbf3dbf95e876b45b2ecd98dd07c Reviewed-on: https://go-review.googlesource.com/c/151257 Run-TryBot: Tobias Klauser TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- util.go | 2 +- util_plan9.go | 2 +- util_solaris.go | 2 +- util_windows.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/util.go b/util.go index 9a3fb09..3911040 100644 --- a/util.go +++ b/util.go @@ -25,7 +25,7 @@ type State struct { termios unix.Termios } -// IsTerminal returns true if the given file descriptor is a terminal. +// IsTerminal returns whether the given file descriptor is a terminal. func IsTerminal(fd int) bool { _, err := unix.IoctlGetTermios(fd, ioctlReadTermios) return err == nil diff --git a/util_plan9.go b/util_plan9.go index 799f049..9317ac7 100644 --- a/util_plan9.go +++ b/util_plan9.go @@ -21,7 +21,7 @@ import ( type State struct{} -// IsTerminal returns true if the given file descriptor is a terminal. +// IsTerminal returns whether the given file descriptor is a terminal. func IsTerminal(fd int) bool { return false } diff --git a/util_solaris.go b/util_solaris.go index 9e41b9f..3d5f06a 100644 --- a/util_solaris.go +++ b/util_solaris.go @@ -17,7 +17,7 @@ type State struct { termios unix.Termios } -// IsTerminal returns true if the given file descriptor is a terminal. +// IsTerminal returns whether the given file descriptor is a terminal. func IsTerminal(fd int) bool { _, err := unix.IoctlGetTermio(fd, unix.TCGETA) return err == nil diff --git a/util_windows.go b/util_windows.go index 8618955..6cb8a95 100644 --- a/util_windows.go +++ b/util_windows.go @@ -26,7 +26,7 @@ type State struct { mode uint32 } -// IsTerminal returns true if the given file descriptor is a terminal. +// IsTerminal returns whether the given file descriptor is a terminal. func IsTerminal(fd int) bool { var st uint32 err := windows.GetConsoleMode(windows.Handle(fd), &st)