diff --git a/list-type.go b/list-type.go index f97990e..5b9eba7 100644 --- a/list-type.go +++ b/list-type.go @@ -147,3 +147,13 @@ func deepSame(a, b any, deepCmp deepFuncTemplate) (eq bool, err error) { return } + +func (list *ListType) setItem(index int64, value any) (err error) { + if index >= 0 && index < int64(len(*list)) { + (*list)[index] = value + } else { + err = fmt.Errorf("index %d out of bounds (0, %d)", index, len(*list)-1) + } + return +} +