burrow: github.com/hyperledger/burrow/util/slice Index | Files

package slice

import "github.com/hyperledger/burrow/util/slice"

Index

Package Files

slice.go

func Concat Uses

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

Concatenate slices into a single slice

func CopyAppend Uses

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 Uses

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

Prepend elements to slice in the order they appear

func DeepFlatten Uses

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 Uses

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 Uses

func EmptySlice() []interface{}

func Flatten Uses

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 Uses

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

Convenience function

Package slice is imported by 14 packages. Updated 2019-11-06. Refresh now. Tools for package owners.