cliutil

package
v2.11.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscardAfterClose

func DiscardAfterClose(wc io.WriteCloser) io.WriteCloser

DiscardAfterClose is an io.WriteCloser that discards writes after it is closed without errors. It is useful as a target for a slog.Sink such that an underlying WriteCloser, like a file, can be cleaned up without race conditions from still-active loggers.

func Hostname added in v2.5.0

func Hostname() string

Hostname returns the hostname of the machine, lowercased, with any trailing domain suffix stripped. It is cached after the first call. If the hostname cannot be determined, for any reason, localhost will be returned instead.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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