slice

package
v0.34.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2021 License: Apache-2.0 Imports: 0 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Concat

func Concat(slices ...[]interface{}) []interface{}

Concatenate slices into a single slice

func CopyAppend

func CopyAppend(slice []interface{}, elements ...interface{}) []interface{}

Like append but on the interface{} type and always to a fresh backing array so can be used safely with slices over arrays you did not create.

func CopyPrepend

func CopyPrepend(slice []interface{}, elements ...interface{}) []interface{}

Prepend elements to slice in the order they appear

func DeepFlatten

func DeepFlatten(slice []interface{}, depth int) []interface{}

Recursively flattens a list by splicing any sub-lists into their parent until depth is reached. If a negative number is passed for depth then it continues until no elements of the returned list are lists

func Delete

func Delete(slice []interface{}, i int, n int) []interface{}

Deletes n elements starting with the ith from a slice by splicing. Beware uses append so the underlying backing array will be modified!

func EmptySlice

func EmptySlice() []interface{}

func Flatten

func Flatten(slice []interface{}) []interface{}

Flatten a slice by a list by splicing any elements of the list that are themselves lists into the slice elements to the list in place of slice itself

func Slice

func Slice(elements ...interface{}) []interface{}

Convenience function

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL