util

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Overview

Package util provides utility functions for operations like sorting and iterating over slices and maps

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSortedMapKeys

func GetSortedMapKeys(m map[string]string) []string

GetSortedMapKeys returns a sorted slice of keys from a map for deterministic iteration.

func SortAndIterateSlice

func SortAndIterateSlice(slice []string, fn SliceProcessor)

SortAndIterateSlice sorts a slice and applies a function to each item. This centralizes the common pattern of creating a copy of a slice, sorting it, and then iterating over the sorted values.

Types

type SliceProcessor

type SliceProcessor func(string)

SliceProcessor is a function that processes a string item.

Jump to

Keyboard shortcuts

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