utils

package
v0.0.0-...-bb469ea Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright 2022 Reto Gantenbein SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](s []T, e T) bool

Contains checks if slice contains element

func FilenameFromURI

func FilenameFromURI(uri string) string

FilenameFromURI returns the last element of an URI If the URI is empty, FilenameFromUri returns "/".

func FilepathFromURI

func FilepathFromURI(uri string) string

FilepathFromURI returns all but the last element of an URI If the URI is empty, FilepathFromURI returns "/".

func KeysFromMap

func KeysFromMap[T constraints.Ordered, S any](a map[T]S) []T

KeysFromMap returns a list of the keys of a map

func ListDifference

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

ListDifference returns the difference of 2 lists (items in `a` that don’t exist in `b`)

func ListIntersection

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

ListIntersection returns the intersection of 2 lists (unique list of all items in both)

func RouteFromURI

func RouteFromURI(uri string) string

RouteFromURI returns the element before the second "/".

Types

This section is empty.

Jump to

Keyboard shortcuts

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