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

util

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RestoreSTD

type RestoreSTD struct {
	// contains filtered or unexported fields
}

func RedirectStdToFiles

func RedirectStdToFiles() (*RestoreSTD, error)

RedirectStdToFiles replaces stdout and stderr with file writers in the working directory. The returned struct has functions to revert replacement of stdout and err with fs files.

func RedirectStdToFilesIn added in v0.0.2

func RedirectStdToFilesIn(dir string) (*RestoreSTD, error)

RedirectStdToFilesIn is RedirectStdToFiles writing into dir, which is created if it does not exist. An app that already has a place for its scratch files can keep the logs there instead of dropping them wherever it was started.

func (*RestoreSTD) AddCallback

func (r *RestoreSTD) AddCallback(f func())

func (*RestoreSTD) Restore

func (r *RestoreSTD) Restore()

func (*RestoreSTD) Run

func (r *RestoreSTD) Run(f func())

Jump to

Keyboard shortcuts

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