From 85b815da3baeec7ef91abda63bb28a62d91050f3 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Mon, 2 May 2022 11:22:53 +0100 Subject: [PATCH] Documentation. --- date.go | 2 +- file.go | 6 +++--- list.go | 4 ++-- progress.go | 4 ++-- zenity.go | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/date.go b/date.go index fcfffd2..1ecafd9 100644 --- a/date.go +++ b/date.go @@ -9,7 +9,7 @@ import ( // Valid options: Title, Width, Height, OKLabel, CancelLabel, ExtraButton, // Icon, DefaultDate. // -// May return: ErrCanceled. +// May return: ErrCanceled, ErrExtraButton. func Calendar(text string, options ...Option) (time.Time, error) { return calendar(text, applyOptions(options)) } diff --git a/file.go b/file.go index def12f3..f2dd8ce 100644 --- a/file.go +++ b/file.go @@ -39,14 +39,14 @@ func Directory() Option { return funcOption(func(o *options) { o.directory = true }) } -// ConfirmOverwrite returns an Option to confirm file selection if filename +// ConfirmOverwrite returns an Option to confirm file selection if the file // already exists. func ConfirmOverwrite() Option { return funcOption(func(o *options) { o.confirmOverwrite = true }) } -// ConfirmCreate returns an Option to confirm file selection if filename does -// not yet exist (Windows only). +// ConfirmCreate returns an Option to confirm file selection if the file +// does not yet exist (Windows only). func ConfirmCreate() Option { return funcOption(func(o *options) { o.confirmCreate = true }) } diff --git a/list.go b/list.go index 75d7638..8cf47ba 100644 --- a/list.go +++ b/list.go @@ -12,7 +12,7 @@ func List(text string, items []string, options ...Option) (string, error) { // ListItems displays the list dialog. // -// May return: ErrCanceled, ErrExtraButton. +// May return: ErrCanceled. func ListItems(text string, items ...string) (string, error) { return List(text, items) } @@ -29,7 +29,7 @@ func ListMultiple(text string, items []string, options ...Option) ([]string, err // ListMultipleItems displays the list dialog, allowing multiple items to be selected. // -// May return: ErrCanceled, ErrExtraButton. +// May return: ErrCanceled. func ListMultipleItems(text string, items ...string) ([]string, error) { return ListMultiple(text, items) } diff --git a/progress.go b/progress.go index ecb32be..623ca2c 100644 --- a/progress.go +++ b/progress.go @@ -5,7 +5,7 @@ package zenity // Valid options: Title, Width, Height, OKLabel, CancelLabel, ExtraButton, // Icon, MaxValue, Pulsate, NoCancel, TimeRemaining. // -// May return: ErrUnsupported +// May return: ErrUnsupported. func Progress(options ...Option) (ProgressDialog, error) { return progress(applyOptions(options)) } @@ -27,7 +27,7 @@ type ProgressDialog interface { // Close closes the dialog. Close() error - // Done returns a channel that's closed when the dialog is closed. + // Done returns a channel that is closed when the dialog is closed. Done() <-chan struct{} } diff --git a/zenity.go b/zenity.go index 5aacee4..b12a144 100644 --- a/zenity.go +++ b/zenity.go @@ -124,7 +124,7 @@ func CancelLabel(cancel string) Option { return funcOption(func(o *options) { o.cancelLabel = &cancel }) } -// ExtraButton returns an Option to add an extra button. +// ExtraButton returns an Option to add one extra button. func ExtraButton(extra string) Option { return funcOption(func(o *options) { o.extraButton = &extra }) } @@ -150,7 +150,7 @@ func Icon(icon DialogIcon) Option { return icon } // Context returns an Option to set a Context that can dismiss the dialog. // -// Dialogs dismissed by the Context return Context.Err. +// Dialogs dismissed by ctx return ctx.Err(). func Context(ctx context.Context) Option { return funcOption(func(o *options) { o.ctx = ctx }) }