diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e637c76b..0e71cb7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-latest] - go: ['1.18', '1.19', '1.20'] + go: ['1.19', '1.20'] steps: - name: Set up Go uses: actions/setup-go@v2 diff --git a/history.go b/history.go index e75c6459..9bf68d19 100644 --- a/history.go +++ b/history.go @@ -16,9 +16,7 @@ func (h *History) Add(input string) { // Clear to clear the history. func (h *History) Clear() { h.tmp = make([]string, len(h.histories)) - for i := range h.histories { - h.tmp[i] = h.histories[i] - } + copy(h.tmp, h.histories) h.tmp = append(h.tmp, "") h.selected = len(h.tmp) - 1 } diff --git a/input_posix.go b/input_posix.go index cfa7cd26..1eae228e 100644 --- a/input_posix.go +++ b/input_posix.go @@ -14,8 +14,7 @@ const maxReadBytes = 1024 // PosixParser is a ConsoleParser implementation for POSIX environment. type PosixParser struct { - fd int - origTermios syscall.Termios + fd int } // Setup should be called before starting input