From 45aecb7a66ced20248336bd0271f1f6dc24ec7f1 Mon Sep 17 00:00:00 2001 From: Adrien Waksberg Date: Sat, 19 Oct 2019 08:24:44 +0200 Subject: [PATCH] fix: bug in select item --- CHANGELOG.md | 4 ++++ gpm/cli.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 15f3399..08583bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/) ## Unreleased +### Fixed + +- Bug in select item + ## v1.2.0 - 2019-09-01 ### Added diff --git a/gpm/cli.go b/gpm/cli.go index adfdeff..6efca31 100644 --- a/gpm/cli.go +++ b/gpm/cli.go @@ -118,11 +118,11 @@ func (c *Cli) selectEntry() Entry { for true { index, err := strconv.Atoi(c.input("Select the entry: ", "", true)) if err == nil && index >= 0 && index+1 <= max { + c1 <- index break } fmt.Println("your choice is not an integer or is out of range") } - c1 <- index }(len(entries)) select {