No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd
.gitignore
LICENSE
Makefile
README.md
main.go

README.md

passwordgetter

A basic cli tool that uses golang.org/x/crypto/ssh/terminal's method terminal.ReadPassword to get a password.

Purpose

This was to help me understand stubbing the interface for stdin capture, as I've been writing tests for a lot of CLI apps recently.

The idea was from this StackOverflow question: https://stackoverflow.com/questions/38573176/mocking-crypto-ssh-terminal

And the code was based on https://github.com/isaacasensio/memo - which already had some stubbing in it!

Installation

Via Go

$ go get github.com/petems/passwordgetter

Usage

$ passwordgetter
Enter password:

Your password was: hunter2