xslices

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package xslices is the addition/ extension to the official slices package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fill

func Fill[S ~[]E, E any](slice S, value E)

Fill fills the slice with the provided value. Fill zeros the elements in the slice before overriding them.

This function is much faster than using [copy] – if you have many values (i.e. >10).

func FillValues

func FillValues[S ~[]E, E any](slice S, values ...E)

FillValues fills the slice with the given values. It basically overrides all elements in slice with values. Fill zeros the elements in the slice before overriding them.

This function is much faster than using [copy] – if you have many values (i.e. >10).

WARN: The function panics if the length of values is greater than the length of slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳