util

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 12

Documentation

Overview

Package util contains utility functions.

Package util contains utility functions for working with strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTestCase

func CheckTestCase(t *testing.T, res *types.ValidationRuleResult, expectedResult types.ValidationRuleResult, err, expectedError error)

CheckTestCase checks the result of a validation rule against the expected result.

func DeDupeStrSlice added in v0.0.47

func DeDupeStrSlice(ss []string) []string

DeDupeStrSlice deduplicates a slices of strings

func Gzip added in v0.0.46

func Gzip(input, output string) error

Gzip compresses a file using gzip and writes the result to disk

func Ptr

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

Ptr returns a pointer to any arbitrary variable.

func Sanitize added in v0.0.47

func Sanitize(s string) string

Sanitize sends a string to lowercase, trims whitespace, replaces all non alphanumeric characters with a dash, removes consecutive dashes, and trims any leading or trailing dashes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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