From bc7f960c2ec178cd8e203160ea9067786dcc7f49 Mon Sep 17 00:00:00 2001 From: Wayne Ashley Berry <727262+wayneashleyberry@users.noreply.github.com> Date: Tue, 12 Oct 2021 07:38:02 +0100 Subject: [PATCH] adds example --- terminaldimensions_test.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/terminaldimensions_test.go b/terminaldimensions_test.go index b5118b7..a30641d 100644 --- a/terminaldimensions_test.go +++ b/terminaldimensions_test.go @@ -1,6 +1,9 @@ package terminaldimensions -import "testing" +import ( + "fmt" + "testing" +) func Test_parse(t *testing.T) { type args struct { @@ -40,3 +43,12 @@ func Test_parse(t *testing.T) { }) } } + +func ExampleDimensions() { + x, y, err := Dimensions() + if err != nil { + panic(err) + } + + fmt.Printf("Terminal is %d wide and %d high", x, y) +}