util

package
v1.27.1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MPL-2.0 Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandTilde

func ExpandTilde(path string) string

ExpandTilde expands environment variables and a leading ~ or ~/ to the user's home directory. If the home directory cannot be determined, the original path is returned unchanged.

func RandStringBytes

func RandStringBytes(n int) string

func UserHomeDir

func UserHomeDir() (string, error)

UserHomeDir returns the home directory for the executing user.

This extends the logic of os.UserHomeDir() with the now archived package github.com/mitchellh/go-homedir for compatibility.

Types

This section is empty.

Directories

Path Synopsis
Package goleaktest provides a small helper for wiring go.uber.org/goleak into a package's TestMain so goroutine leaks fail the test suite.
Package goleaktest provides a small helper for wiring go.uber.org/goleak into a package's TestMain so goroutine leaks fail the test suite.
iojoin provides a utility for joining two concurrent units of work that share resources.
iojoin provides a utility for joining two concurrent units of work that share resources.

Jump to

Keyboard shortcuts

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