Help us shape the future of Go! Take the 2026 Go Developer Survey

util

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const Whitespace = " \t"

Whitespace is the whitespace of Compono: U+0020 (space) and U+0009 (tab).

Variables

This section is empty.

Functions

func DisallowedURLScheme added in v0.7.0

func DisallowedURLScheme(url string) (string, bool)

DisallowedURLScheme returns the lowercased scheme of the normalized url and true when the url has a scheme other than http, https, mailto or tel. The url has a scheme when it starts with an ASCII letter followed only by ASCII letters, digits, '+', '-' and '.' up to its first ':'. Otherwise it is a relative url and is allowed.

func InSliceInt

func InSliceInt(needle int, haystack []int) bool

func InSliceString

func InSliceString(needle string, haystack []string) bool

func IsKebabCase added in v0.4.0

func IsKebabCase(val string) bool

func IsScreamingSnakeCase

func IsScreamingSnakeCase(val string) bool

func NormalizeURL added in v0.7.0

func NormalizeURL(url string) string

NormalizeURL returns url as the WHATWG URL parser reads it before it looks for a scheme: without leading and trailing C0 control characters (U+0000 to U+001F) and spaces, and without any ASCII tab or newline (U+0009, U+000A, U+000D) inside it.

func ToKebabCase added in v0.4.0

func ToKebabCase(val string) string

func TrimWhitespace added in v0.7.0

func TrimWhitespace(s string) string

TrimWhitespace returns s without the Compono whitespace at its start and end.

Types

This section is empty.

Jump to

Keyboard shortcuts

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