From 7b437abd09580e4ec204ea39cd25466034a9af19 Mon Sep 17 00:00:00 2001 From: aoright <102943475+aoright@users.noreply.github.com> Date: Thu, 20 Aug 2026 14:17:37 +0800 Subject: [PATCH] test: add TestStdoutStderr and fix doc comment typos Signed-off-by: aoright <102943475+aoright@users.noreply.github.com> --- browser.go | 4 ++-- browser_test.go | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 browser_test.go diff --git a/browser.go b/browser.go index d7969d7..969086e 100644 --- a/browser.go +++ b/browser.go @@ -1,6 +1,6 @@ // Package browser provides helpers to open files, readers, and urls in a browser window. // -// The choice of which browser is started is entirely client dependant. +// The choice of which browser is started is entirely client dependent. package browser import ( @@ -18,7 +18,7 @@ var Stdout io.Writer = os.Stdout // Stderr is the io.Writer to which executed commands write standard error. var Stderr io.Writer = os.Stderr -// OpenFile opens new browser window for the file path. +// OpenFile opens a new browser window for the file path. func OpenFile(path string) error { path, err := filepath.Abs(path) if err != nil { diff --git a/browser_test.go b/browser_test.go new file mode 100644 index 0000000..82f54e5 --- /dev/null +++ b/browser_test.go @@ -0,0 +1,14 @@ +package browser + +import ( + "testing" +) + +func TestStdoutStderr(t *testing.T) { + if Stdout == nil { + t.Error("Stdout should not be nil") + } + if Stderr == nil { + t.Error("Stderr should not be nil") + } +}