kit

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSlug added in v0.9.0

func GenerateSlug(s string) string

GenerateSlug creates a URL-safe slug from a string

func MapValues

func MapValues[K comparable, V any](m map[K]V) []V
Example
ages := map[string]int{
	"aFirstName":  1,
	"aSecondName": 3,
	"aThirdName":  5,
}

values := MapValues(ages)
fmt.Println(len(values)) // Order not guaranteed, just print length
Output:

3

func WrapError

func WrapError(err error, format string, a ...any) error
Example
err := errors.New("file not found")
wrapped := WrapError(err, "failed to load config")
fmt.Println(wrapped.Error())
Output:

failed to load config: file not found

Types

type ClockInterface added in v0.4.0

type ClockInterface interface {
	Now() time.Time
}

func NewClock added in v0.4.1

func NewClock(opts ...ClockOption) ClockInterface

type ClockOption added in v0.4.0

type ClockOption func(*clock)

func WithFake added in v0.4.0

func WithFake(timeFunc FakeTimeFunc) ClockOption

type FakeTimeFunc added in v0.4.0

type FakeTimeFunc func() time.Time

Jump to

Keyboard shortcuts

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