getpass

package module
v0.0.0-...-cdc1f6b Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2017 License: MIT Imports: 3 Imported by: 0

README

A tiny Go library for reading passwords typed in a terminal without echoing output, inspired by Python's getpass.

It is compatible with modern Windows and *nix systems that use cmd.exe, powershell, bash, or sh.

Example:

import "github.com/princebot/getpass"

func main() {
    pw, err := getpass.Get("prompt to display to user goes here")
    if err != nil {
        // Do something with password.
    }
}

Documentation

Overview

Package getpass reads passwords without echoing output.

The current implementation is compatible with modern Windows and *nix systems that use cmd.exe, PowerShell, Bash, or Bourne shell environments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(prompt string) ([]byte, error)

Get reads a line from stdin with local echoing disabled and returns it.

If prompt is not an empty string, Get displays it before reading input. If echoing cannot be disabled for the current terminal, Get quits with an error instead of attempting to read input.

Types

This section is empty.

Jump to

Keyboard shortcuts

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