Skip to content

Commit

Permalink
adds example
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneashleyberry committed Oct 12, 2021
1 parent 7fd2354 commit bc7f960
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion terminaldimensions_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package terminaldimensions

import "testing"
import (
"fmt"
"testing"
)

func Test_parse(t *testing.T) {
type args struct {
Expand Down Expand Up @@ -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)
}

0 comments on commit bc7f960

Please sign in to comment.