utils

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendUnique

func AppendUnique[T comparable](out *[]T, already Set[T], v T) bool

AppendUnique adds the value v to the slice pointed to by out **only if** it hasn't been seen before. "already" tracks which values were already added

func DownloadSBOMFromURL

func DownloadSBOMFromURL(url string) ([]byte, error)

func HandleURL

func HandleURL(path string) (string, string, error)

func IsBlank

func IsBlank(s string) bool

IsBlank reports whether s is empty or only whitespace (Unicode-aware).

func IsDir

func IsDir(path string) bool

func IsGit

func IsGit(in string) bool

func IsURL

func IsURL(in string) bool

func RemoveEmptyStrings

func RemoveEmptyStrings(input []string) []string

Types

type Set

type Set[T comparable] map[T]struct{}

Set[T] is a generic "set" of values of type T. Internally it's a map[T]struct{}

Jump to

Keyboard shortcuts

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