utils

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2025 License: Unlicense, MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetKeys

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

GetKeys returns a slice containing all the keys from the provided map.

Parameters

- m (map[string]string): The input map from which to extract keys.

Return Values

- []string: A slice of strings representing the keys in the map.

Expected behaviour

- Iterates over each key in the map and appends it to a new slice.

- Returns the slice containing all the keys.

func SingleJoiningSlash

func SingleJoiningSlash(a, b string) string

SingleJoiningSlash joins two strings with a single slash between them, ensuring that the resulting path doesn't contain multiple consecutive slashes.

Parameters

- a (string): The first string to join.

- b (string): The second string to join.

Return Values

- result (string): The joined string with a single slash between them if needed.

Expected behaviour

- If both a and b start and end with a slash, the resulting string will have only one slash between them.

- If neither a nor b starts or ends with a slash, the strings will be joined with a single slash in between.

- Otherwise, the two strings are simply concatenated.

Types

This section is empty.

Jump to

Keyboard shortcuts

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