General

package
v0.3.31 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 4 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNil added in v0.2.9

func IsNil[T any](value T) bool

IsNil is a function that checks if a value is nil.

Parameters:

  • value: The value to check.

Return:

  • bool: True if the value is nil, false otherwise.

func RunInPowerShell added in v0.2.20

func RunInPowerShell(program string, args ...string) uc.MainFunc

RunInPowerShell is a function that returns a function that runs a program in a new PowerShell process.

Upon calling the returned function, a new PowerShell process is started with the specified program and arguments. The function returns an error if the process cannot be started.

Parameters:

  • program: The path to the program to run.
  • args: The arguments to pass to the program.

Return:

  • MainFunc: A function that runs the program in a new PowerShell process.

func SplitIntoGroups

func SplitIntoGroups[T any](slice []T, n int) [][]T

SplitIntoGroups splits the slice into n groups and returns a 2D slice where each inner slice represents a group.

Parameters:

  • slice: The slice to split.
  • n: The number of groups to split the slice into.

Return:

  • [][]T: A 2D slice where each inner slice represents a group. Nil if n is less than or equal to 0.

Example:

slice := []int{1, 2, 3, 4, 5}
n := 3
groups := SplitIntoGroups(slice, n)
fmt.Println(groups) // Output: [[1 4] [2 5] [3]]

Types

This section is empty.

Jump to

Keyboard shortcuts

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