utils

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert2DMapRowTo2DSlice

func Convert2DMapRowTo2DSlice[T any](_2dMap map[string][]*T) (result [][]*T, indexName []string)

Convert2DMapRowTo2DSlice input:

data := map[string][]int{
		"row1": {1,2,3},
		"row2": {4,5,6},
		"row3": {7,8,9}
	}

Output:

data := [][]int{
		{1,2,3},
		{4,5,6},
		{7,8,9},
}

index: row1, row2, row3

func ConvertArrayToArrayPointer

func ConvertArrayToArrayPointer[T any](source []T) []*T

func GetColValuesOf2DMapRow

func GetColValuesOf2DMapRow[T any](_2dMap map[string][]*T, indexCol int) (result []*T, indexName []string, err error)

func GetColValuesOf2DMapRowAndIndex

func GetColValuesOf2DMapRowAndIndex[T any](_2dMap map[string][]*T, indexCol int, indexName []string) (result []*T, err error)

func GetColValuesOf2DSlice

func GetColValuesOf2DSlice[T any](_2dSlice [][]*T, indexCol int) []*T

func GetNumberColOfMapRow

func GetNumberColOfMapRow[T any](_2dMap map[string][]*T) int

func MaxPointer

func MaxPointer[T int | int8 | int64 | float32 | float64](x, y *T) *T

func MinPointer

func MinPointer[T int | int8 | int64 | float32 | float64](x, y *T) *T

func PrettyPrint

func PrettyPrint(v interface{}) ([]byte, error)

func PrettyPrint2

func PrettyPrint2(v interface{})

func SampleIntMapMatrix

func SampleIntMapMatrix() (data map[string][]*int, index []string)

func SampleIntMatrix

func SampleIntMatrix() (data [][]*int)

func SampleStringMapMatrix

func SampleStringMapMatrix() (data map[string][]*string, index []string)

func SumPointer

func SumPointer[T int | int8 | int64 | float32 | float64](x, y *T) *T

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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