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

reader

package
v0.2.54 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskYesNo added in v0.2.54

func AskYesNo() bool

AskYesNo prints nothing itself — the caller is expected to have already prompted the user. It reads one line from stdin and returns true unless the user explicitly types "n" or "no" (case-insensitive). An empty input (just pressing Enter) is treated as yes. Any read error (including Ctrl+C / SIGINT cancellation) is treated as no.

func IsStdinTerminal added in v0.2.54

func IsStdinTerminal() bool

IsStdinTerminal reports whether stdin is connected to an interactive terminal. Returns false when stdin is a pipe, a file redirect, or otherwise non-interactive.

func ReadString

func ReadString() (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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