strutil

package
v0.23.2 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendInt

func AppendInt(b []byte, x int, width int) []byte

AppendInt appends the decimal form of x to b and returns the result. If the decimal form is shorter than width, the result is padded with leading 0's. If the decimal is longer than width, returns formatted decimal without any truncation.

func JoinIDs

func JoinIDs[T ~int | ~int32 | ~int64](prefix string, ids []T) string

JoinIDs joins a slice of any ids into a comma separated string. Each ID could be prefixed with a string (e.g. n1, n2, n3 to represent nodes).

Types

This section is empty.

Jump to

Keyboard shortcuts

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