From ca3c58166ed802c9810ffc499b01bc1cd2e0153a Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 30 Nov 2018 13:33:40 +0100 Subject: [PATCH] all: use "reports whether" in godoc comments Go documentation style for boolean funcs is to say: // Foo reports whether ... func Foo() bool rather than "returns true if" or "returns whether". Change-Id: I5d01c45a8867b47462ed142a49ad51bf0a319ce1 Reviewed-on: https://go-review.googlesource.com/c/151957 Reviewed-by: Elias Naur --- bind/gen.go | 6 +++--- bind/genjava.go | 2 +- event/lifecycle/lifecycle.go | 2 +- event/mouse/mouse.go | 2 +- exp/audio/al/al.go | 4 ++-- internal/importers/java/java.go | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bind/gen.go b/bind/gen.go index 74646c1..b796893 100644 --- a/bind/gen.go +++ b/bind/gen.go @@ -458,8 +458,8 @@ func (g *Generator) validPkg(pkg *types.Package) bool { return false } -// isSigSupported returns whether the generators can handle a given -// function signature +// isSigSupported reports whether the generators can handle a given +// function signature. func (g *Generator) isSigSupported(t types.Type) bool { sig := t.(*types.Signature) params := sig.Params() @@ -477,7 +477,7 @@ func (g *Generator) isSigSupported(t types.Type) bool { return true } -// isSupported returns whether the generators can handle the type. +// isSupported reports whether the generators can handle the type. func (g *Generator) isSupported(t types.Type) bool { if isErrorType(t) || isWrapperType(t) { return true diff --git a/bind/genjava.go b/bind/genjava.go index 03ce9a1..ff89bea 100644 --- a/bind/genjava.go +++ b/bind/genjava.go @@ -372,7 +372,7 @@ func (g *JavaGen) javadoc(doc string) { g.Printf("/**\n * %s */\n", html.EscapeString(doc)) } -// hasThis returns whether a method has an implicit "this" parameter. +// hasThis reports whether a method has an implicit "this" parameter. func (g *JavaGen) hasThis(sName string, m *types.Func) bool { sig := m.Type().(*types.Signature) params := sig.Params() diff --git a/event/lifecycle/lifecycle.go b/event/lifecycle/lifecycle.go index bed3b49..9a5f54e 100644 --- a/event/lifecycle/lifecycle.go +++ b/event/lifecycle/lifecycle.go @@ -58,7 +58,7 @@ func (e Event) String() string { return fmt.Sprintf("lifecycle.Event{From:%v, To:%v, DrawContext:%v}", e.From, e.To, e.DrawContext) } -// Crosses returns whether the transition from From to To crosses the stage s: +// Crosses reports whether the transition from From to To crosses the stage s: // - It returns CrossOn if it does, and the lifecycle change is positive. // - It returns CrossOff if it does, and the lifecycle change is negative. // - Otherwise, it returns CrossNone. diff --git a/event/mouse/mouse.go b/event/mouse/mouse.go index 45029cc..eec2fc0 100644 --- a/event/mouse/mouse.go +++ b/event/mouse/mouse.go @@ -40,7 +40,7 @@ type Event struct { // Button is a mouse button. type Button int32 -// IsWheel returns whether the button is for a scroll wheel. +// IsWheel reports whether the button is for a scroll wheel. func (b Button) IsWheel() bool { return b < 0 } diff --git a/exp/audio/al/al.go b/exp/audio/al/al.go index bb7bf84..0263037 100644 --- a/exp/audio/al/al.go +++ b/exp/audio/al/al.go @@ -37,7 +37,7 @@ func Disable(c Capability) { alDisable(int32(c)) } -// Enabled returns true if the specified capability is enabled. +// Enabled reports whether the specified capability is enabled. func Enabled(c Capability) bool { return alIsEnabled(int32(c)) } @@ -450,7 +450,7 @@ func (b Buffer) BufferData(format uint32, data []byte, freq int32) { alBufferData(b, format, data, freq) } -// Valid returns true if the buffer exists and is valid. +// Valid reports whether the buffer exists and is valid. func (b Buffer) Valid() bool { return alIsBuffer(b) } diff --git a/internal/importers/java/java.go b/internal/importers/java/java.go index 4f1c89e..3a26dfb 100644 --- a/internal/importers/java/java.go +++ b/internal/importers/java/java.go @@ -159,7 +159,7 @@ func (e *errClsNotFound) Error() string { return "class not found: " + e.name } -// IsAvailable returns whether the required tools are available for +// IsAvailable reports whether the required tools are available for // Import to work. In particular, IsAvailable checks the existence // of the javap binary. func IsAvailable() bool {