Skip to content

Commit

Permalink
style: fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinJWendt committed May 8, 2021
1 parent af21dee commit 076114b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
4 changes: 2 additions & 2 deletions cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ func HorizontalAbsolute(n int) {
}

// Show the cursor if it was hidden previously.
// Don't forget to show the cursor atleast at the end of your application.
// Don't forget to show the cursor at least at the end of your application.
// Otherwise the user might have a terminal with a permanently hidden cursor, until he reopens the terminal.
func Show() {
fmt.Print("\x1b[?25h")
}

// Hide the cursor.
// Don't forget to show the cursor atleast at the end of your application with Show.
// Don't forget to show the cursor at least at the end of your application with Show.
// Otherwise the user might have a terminal with a permanently hidden cursor, until he reopens the terminal.
func Hide() {
fmt.Print("\x1b[?25l")
Expand Down
4 changes: 2 additions & 2 deletions cursor_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func HorizontalAbsolute(n int) {
}

// Show the cursor if it was hidden previously.
// Don't forget to show the cursor atleast at the end of your application.
// Don't forget to show the cursor at least at the end of your application.
// Otherwise the user might have a terminal with a permanently hidden cursor, until he reopens the terminal.
func Show() {
handle := syscall.Handle(os.Stdout.Fd())
Expand All @@ -78,7 +78,7 @@ func Show() {
}

// Hide the cursor.
// Don't forget to show the cursor atleast at the end of your application with Show.
// Don't forget to show the cursor at least at the end of your application with Show.
// Otherwise the user might have a terminal with a permanently hidden cursor, until he reopens the terminal.
func Hide() {
handle := syscall.Handle(os.Stdout.Fd())
Expand Down
12 changes: 2 additions & 10 deletions utils.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
package cursor

import (
"runtime"
)

var height int

// Bottom moves the cursor to the bottom of the terminal.
// This is done by calculating how many lines were moved by Up and Down.
func Bottom() {
if runtime.GOOS == "windows" {
Down(height)
} else {
Down(height)
}
Down(height)
StartOfLine()
height = 0
}
Expand Down Expand Up @@ -47,7 +39,7 @@ func DownAndClear(n int) {
ClearLine()
}

// Move moves the cursor relative by x and y
// Move moves the cursor relative by x and y.
func Move(x, y int) {
if x > 0 {
Right(x)
Expand Down

0 comments on commit 076114b

Please sign in to comment.