slice

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2018 License: Apache-2.0 Imports: 0 Imported by: 6 modules, 15 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 DeleteAt

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

Delete an element at a specific index and return the contracted list

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