uhelpers

package module
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: MIT Imports: 5 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallForByteArrayLineByLine added in v1.0.17

func CallForByteArrayLineByLine(in []byte, f func(string, ...interface{}), prefix ...string)

func CompareBoolPointers added in v1.0.12

func CompareBoolPointers(ptr1 *bool, ptr2 *bool, bothNilReturnTrue ...bool) bool

func CompareStringPointers

func CompareStringPointers(ptr1 *string, ptr2 *string, bothNilReturnTrue ...bool) bool

func FirstDayOfISOWeek added in v1.0.9

func FirstDayOfISOWeek(reference time.Time) time.Time

Figure out which day is the first of an ISOWeek

func FirstDayOfMonth added in v1.0.9

func FirstDayOfMonth(reference time.Time) time.Time

Get the first day of the month

func FirstDayOfYear added in v1.0.9

func FirstDayOfYear(reference time.Time) time.Time

Get the first day of a year

func FirstHourOfDay added in v1.0.9

func FirstHourOfDay(reference time.Time) *time.Time

Get first hour of a day

func FmtDuration added in v1.0.14

func FmtDuration(d time.Duration) string

func IsMatchingBoolPointerInMap added in v1.0.12

func IsMatchingBoolPointerInMap(ptr1 *bool, rawMap interface{}, key string, bothNilReturnTrue ...bool) bool

func IsMatchingStringPointerInMap

func IsMatchingStringPointerInMap(ptr1 *string, rawMap interface{}, key string, bothNilReturnTrue ...bool) bool

func IsSameDayWithoutTimezoneSupport added in v1.0.9

func IsSameDayWithoutTimezoneSupport(t time.Time, other time.Time) bool

Check if two time.Time are on the same day

func KeysFromMap added in v1.1.2

func KeysFromMap[T any, K comparable](m map[K]T) []K

func Must added in v1.1.8

func Must[T any](v T, err error) T

func NewTimer added in v1.1.7

func NewTimer() timer

func Ptr added in v1.0.15

func Ptr[T any](in T) *T

func StringIndexOf added in v1.0.6

func StringIndexOf(slice []string, item string) (int, error)

func SubtractSlice added in v1.1.2

func SubtractSlice[T comparable](a []T, b []T) []T

Returns a slice which contains all elements of a that are not in b

func TimeFromMonthAndYear added in v1.0.9

func TimeFromMonthAndYear(year int, month int, timeZone string) (*time.Time, error)

Generate a time.Time from year and mont

func ToInterfaceSlice added in v1.1.2

func ToInterfaceSlice[T any](in []T) []interface{}

Types

This section is empty.

Jump to

Keyboard shortcuts

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