From 92fb9efce9d9f84e06f574243218e3c6d7478d18 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 11 Mar 2014 13:50:02 -0400 Subject: Removed error returns from Combobox.Delete(), Listbox.Delete(), and sysData.delete(), since they are no longer used. Updated the TODO file to mark this issue closed. --- listbox.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'listbox.go') diff --git a/listbox.go b/listbox.go index 63f8722..7e05287 100644 --- a/listbox.go +++ b/listbox.go @@ -70,7 +70,7 @@ badrange: } // Delete removes the given item from the Listbox. It panics if the given index is out of bounds. -func (l *Listbox) Delete(index int) error { +func (l *Listbox) Delete(index int) { l.lock.Lock() defer l.lock.Unlock() @@ -78,13 +78,14 @@ func (l *Listbox) Delete(index int) error { if index < 0 || index >= l.sysData.len() { goto badrange } - return l.sysData.delete(index) + l.sysData.delete(index) + return } if index < 0 || index >= len(l.initItems) { goto badrange } l.initItems = append(l.initItems[:index], l.initItems[index + 1:]...) - return nil + return badrange: panic(fmt.Errorf("index %d out of range in Listbox.Delete()", index)) } -- cgit v1.2.3