I need to hid a password.
I get (mismatched types []byte
and int
).
How can i fix it? How can I convert from int
to []byte
?
package main
import ("fmt"; "github.com/howeyc/gopass")
func main() {
var user string
maping := map[string]int{"dasha": 123, "mike": 777}
fmt.Println("Enter username: ")
fmt.Scan(&user)
fmt.Printf("Enter password: ")
pass, err := gopass.GetPasswd()
if err != nil {
return
}
if pass == maping[user] {
fmt.Println("bingo")
}else{
fmt.Println("the login or password is not correct")
}
}