List interface bug for downstream packages
mr-joshcrane opened this issue · comments
mr-joshcrane commented
Describe the bug
Item is intended to be an interface, but it cant actually imported from other packages.
To Reproduce
func TestSetItems(t *testing.T) {
list := New([]item{}, itemDelegate{}, 10, 10)
items := []item{item("foo"), item("bar")}
list.SetItems(items)
// Does not compile because new takes a slice of Items
// which is a concrete type, not an interface
// In your tests you use Items from your imported package
// not items from your test file, which is hiding this error
}
Short answer is to fix references to []Item 👍
Let me know if you want a PR to fix it