helpers

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package helpers provides shared utility functions used across the application. These are generic helpers that don't belong to a specific domain package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountUniqueStrings

func CountUniqueStrings(items []string) int

CountUniqueStrings returns the number of unique strings in a slice. Useful for counting unique URLs or other string collections.

func TruncateText

func TruncateText(text string, maxLen int) string

TruncateText shortens text to the specified maximum length, adding "..." if truncated. Returns empty string if input is empty or only whitespace. If maxLen is less than 4, returns the original text (can't fit "..." plus content).

func TruncateURL

func TruncateURL(url string, maxLen int) string

TruncateURL shortens a URL to the specified maximum length for display purposes. Adds "..." suffix if the URL exceeds maxLen.

Types

This section is empty.

Jump to

Keyboard shortcuts

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