Golang : Get password from console input without echo or masked

Tags : golang password masking

Found this package https://github.com/howeyc/gopass that allows Golang developers to build text based application that takes in password without echo(silent mode) or use masking.

For example :

 package main

 import (

 func main() {
 fmt.Printf("Enter silent password: ")
 silentPassword := gopass.GetPasswd() // Silent

 // input is in byte and need to convert to string
 // for storing and comparison

 fmt.Printf("Enter masked password: ")
 maskedPassword := gopass.GetPasswdMasked() // Masked


Sample output :

Enter silent password:


Enter masked password: ********


  See also : Golang : Bcrypting password

Tags : golang password masking

By Adam Ng

IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.