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

binaryparam

package
v1.20.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancellableFile added in v1.16.10

func CancellableFile(file *os.File, info os.FileInfo) (io.ReadCloser, error)

CancellableFile takes ownership of file on success. Regular files retain their usual reader; owned FIFOs use nonblocking reads so Close can interrupt them on systems where Go deliberately excludes FIFOs from its runtime poller.

func FileOrStdin

func FileOrStdin(stdin io.ReadCloser, path string) (io.ReadCloser, bool, error)

FileOrStdin opens the file at the given path for reading. If the path is "-", stdin is returned instead.

It's the caller's responsibility to close the returned ReadCloser (usually with `defer`).

Returns a boolean indicating whether stdin is being used. If true, no other components of the calling program should attempt to read from stdin for anything else.

Types

This section is empty.

Jump to

Keyboard shortcuts

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