utils

package
v0.0.0-...-40e63e7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

package utils provides simple transformation functions which do not fit anywhere else in particular.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FloatTimeString

func FloatTimeString(msecs float64) string

FloatTimeString formats length in seconds as H:mm:ss.

func HumanFormatBool

func HumanFormatBool(b bool) string

HumanFormatBool works as strconv.FormatBool, but returns "yes" or "no".

func Max

func Max(a, b int) int

Max returns the maximum of a and b.

func Min

func Min(a, b int) int

Min returns the minimum of a and b.

func ReverseRunes

func ReverseRunes(src []rune) []rune

ReverseRunes returns a new, reversed rune slice.

func TimeRunes

func TimeRunes(secs int) []rune

TimeRunes acts as TimeString, but returns a slice of runes.

func TimeString

func TimeString(secs int) string

TimeString formats length in seconds as H:mm:ss.

func TokenFilter

func TokenFilter(match string, tokens []string) []string

TokenFilter returns a subset of tokens that match the specified prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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